createKeyPressEvent {iSPlot} | R Documentation

## Create callbacks for a key press event

### Description

createKeyPressEvent is used to add pseudo-accelerators to any gtk window. Regardless of which gtk window is active, any gtk window should react as though the accelerators from the main menu still work. So if a view window is active, but the user types Ctrl-Q, the message box asking the user if they would like to quit should pop up, which is the same as what would happen if the control window was active. Any gtk window when it is created should call this function so that all windows opened in iSPlot will react the same to key press events.

### Usage

      createKeyPressEvent(w)

### Arguments

`w` | the gtk window

### Details

The callbacks for the key press events are the same as the accelerators for the main menu on the control window.

### Author(s)

Elizabeth Whalen

### See Also

`createView`, `setKeyValToAction`

### 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
        # createDataSpreadsheet will call createKeyPressEvent
        createView(type = "spreadView", dataName = "USArrests")

        # now you can type Ctrl-Q while the spreadsheet is active and the
        # pop-up window for quitting should appear
      }

[Package iSPlot version 1.0.7 Index]