Link to home
Start Free TrialLog in
Avatar of purplesoup
purplesoupFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Detecting Function Key press on DHTMLEdit control

I cant find a method that im completely happy with for detecting the press of a function key on the DHTMLEdit Control. I specifically am trying to test for F7 but i get the same problem with any function key.

The onkeypress events doesnt fire. It only seems to fire for printable characters.

The onkeydown event does fire. If you then query the event you get the keycode 118 (for F7) e.g.

msgbox(DHTMLEdit1.DOM.parentWindow.event.KeyCode)

118 is also the same keycode as you get in the onkeypress event for "v" so i dont trust it. Strangely in my test environment onkeydown does not seem to fire when you press a printable character but i dont trust that it never will.

I was hoping i could let the event bubble up to the control i have placed the DHTMLEdit control on, but no such luck. The DHTMLEdit control seems to swallow it.

Is there another method to check for the press of a function key whilst the focus is on the DHTMLEdit control?
ASKER CERTIFIED SOLUTION
Avatar of Ark
Ark
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial