setKeyValToAction {iSPlot}R Documentation

Match key presses to the appropriate action


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.


setKeyValToAction(curStr, curState, curKeyval)


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


Elizabeth Whalen

See Also

createKeyPressEvent, createMenuItem, updateCurAction


  if (interactive())
    # should load data through Open Data or Open File under the File menu
    # 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.3 Index]