setKeyValToAction           package:iSPlot           R Documentation

_M_a_t_c_h _k_e_y _p_r_e_s_s_e_s _t_o _t_h_e _a_p_p_r_o_p_r_i_a_t_e _a_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     setKeyValToAction(curStr, curState, curKeyval)

_A_r_g_u_m_e_n_t_s:

  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 

_A_u_t_h_o_r(_s):

     Elizabeth Whalen

_S_e_e _A_l_s_o:

     'createKeyPressEvent', 'createMenuItem', 'updateCurAction'

_E_x_a_m_p_l_e_s:

       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
       }

