I've assigned hotkeys to command buttons by using the Keypress method of the form as follows:
LPARAMETERS nKeyCode, nShiftAltCtrl
DO case
case nKeyCode == 28 && F1
thisform.btnAdd.Click()
case nKeyCode == -1 && F2
thisform.btnDel.Click()
case nKeyCode == -8 && F9
thisform.btnPrint.Click()
ENDCASE
It seems to work fine EXCEPT... if a cell in a grid control has the focus when pressing the hotkey, when the focus is returned to that cell, the text in the cell is replaced by the contents of the keyboard buffer. I tried to include a CLEAR TYPEAHEAD command after the CASE statement above, but that didn't help.
Anyone know how to remove that keystroke from the buffer? Or any ofther good ideas?
LPARAMETERS nKeyCode, nShiftAltCtrl
DO case
case nKeyCode == 28 && F1
thisform.btnAdd.Click()
case nKeyCode == -1 && F2
thisform.btnDel.Click()
case nKeyCode == -8 && F9
thisform.btnPrint.Click()
ENDCASE
It seems to work fine EXCEPT... if a cell in a grid control has the focus when pressing the hotkey, when the focus is returned to that cell, the text in the cell is replaced by the contents of the keyboard buffer. I tried to include a CLEAR TYPEAHEAD command after the CASE statement above, but that didn't help.
Anyone know how to remove that keystroke from the buffer? Or any ofther good ideas?