-
Catching Keyboard events AND getting the current value of an edit field
Dear $all,
I’m trying to implement a remote form based auto-type feature – please see my other post…
My current problem is that I can catch the event the user pressing something like ‘Shift-F4’
with
client method ‘$init’:
JavaScript:window.addEventListener(“keydown”,function(event) {__form.callMethodEx(“keydown”,0,event,event.keyCode) }, true);
# the additional parameter event.keycode will be received as parameter in method keydown()
and
client method ‘keydown’:
Switch p2
Case 115 ## F4-Taste
If ibShiftKey
Calculate icKeyboardShortcut as ‘Shift-F4’
Else
Calculate icKeyboardShortcut as ‘F4’
End If
End Switch
Calculate ibControlKey as p2=17 ## Control Key is 17, remember for next Key Event
Calculate ibCmdKey as p2=91|p2=93
Calculate ibShiftKey as p2=16
Calculate ibOptKey as p2=18
and
client method ‘keyup’:
If icKeyboardShortcut
Do method handleKeyEvent (icText) ## icText is the instance variable bound to the edit field
End If
My problem is that the value of icText (the edit field) is not updated yet at the time when the keyboard event keydown or keyup are fired.
So how can I catch the keyboard shortcuts AND have the current value of the edit field?
Any ideas are greatly appreciated!
Best regards
Uwe
Log in to reply.