setKeyValToAction {iSPlot} | R Documentation

## Match key presses to the appropriate action

### Description

setKeyValToAction is called by createKeyPressEvent to set the appropriate response to a key press event on a gtk window. To do this, setKeyValToAction uses the controlEnv variable, keyVals, which is set when the menu accelerators are set in createMenuItem. Thus, the accelerators for the main menu will match key press events on other gtk windows because they both match with the information stored in the variable, keyVals. This also makes sure that gtk windows are in synch with the main menu even if new menu items are added to the main menu.

### Usage

    setKeyValToAction(curStr, curState, curKeyval)

### Arguments

`curStr` | the character string from the key press
`curState` | the state of the key press (such as if Ctrl was pressed before the key)
`curKeyval` | the numeric value of the key press

### Author(s)

Elizabeth Whalen

### See Also

`createKeyPressEvent`, `createMenuItem`, `updateCurAction`

### Examples

      if (interactive())
      {
        createControlWindow()
        # should load data through Open Data or Open File under the File menu
        data(USArrests)
        loadDFData(USArrests,"USArrests")
        # viewing the data should occur through View Data under the Display menu
        # createView will call createKeyPressEvent, which calls
        # setKeyValToAction
        createView(type="spreadView", dataName="USArrests")

        # typing Ctrl+Q while the spreadsheet is active will cause
        # a pop-up window to appear, asking if you would like to quit
      }

[Package iSPlot version 1.0.7 Index]