Re: Problem with using ALT keys and/or CTRL keys with wxEuphoria
- Posted by Bhupen1277 Apr 27, 2019
- 1640 views
euphoric said...
Do you have those functions in your key event procedure?
This is taken from the catch_keys.exw demo:
procedure onKey( atom this, atom event_type, atom id, atom event ) integer keyIs, controlDown object junk keyIs = get_key_code( event ) -- I added this line to the demo ?key_event_altdown(event) --<-- THIS WORKS FINE (prints 1 when I have altKey pressed, 0 when not) if keyIs != 27 then if keyIs = 13 then msg[$] = msg[$][1..$-1] msg = append(msg,"_") elsif keyIs = 8 then -- deleting if length(msg[$]) > 1 then msg[$] = msg[$][1..$-2] & "_" else if length(msg) > 1 then msg = msg[1..$-1] msg[$] &= "_" end if end if else msg[$] = msg[$][1..$-1] & keyIs & "_" end if refresh_window( this ) else destroy( typeFrame ) end if end procedure set_event_handler( typeWin, -1, wxEVT_CHAR, routine_id("onKey"))
I will try that line again. I tried it inside and also outside in another key-even routine. You could experiment it in any font that is over 512K characters and use the displacement to 256 for the ASCII substitute and a displacement of 384 (256+128) with Alt key or control key. I WILL try again and report back