Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by tep on Nov 04, 2008 19:52
open dhtmlx forum
dhtmlxgrid: disable ctrl + any button

sirs/maams,

i am able to check if ctrl button,alt button or any button is pressed but i cant seem to find a way to differentiate when ctrl + any key or alt + any key is pressed. for example i press ctrl + c, the keycode return onKeyPress event is the same as when 'c' is pressed.
the problem is that in my dhtmlgrid i have a function when a cell is on edit..
i have an i use setOnEditCellHandler, the problem is normally when ctrl or alt is pressed nothing happens..i disbled them to enter edit mode.but when ctrl + c or any key for this matter the cell is opened for edit but the setOnEditCellHandler event handler cant seem to detect that it entered edit mode via ctrl + any key, this causes the function inside my event handler not to work.

i hope you shed some light to this.
thanks in advance..

Answer posted by Support on Nov 05, 2008 03:55
onKeyPress event provides 4 parameters
- key code
- state of ctrl key
- state of shift key
- native event object

you can use second parameter to check state of ctrl-key. If it is not enough - you can poll event object for any additional information.