Re: Problem with using ALT keys and/or CTRL keys with wxEuphoria
- Posted by euphoric (admin) Apr 28, 2019
- 1586 views
I'm not sure if this maintains your exact functionality, but the alt and ctrl keys affect what I type...
procedure onKey( atom this, atom event_type, atom id, atom event ) object junk integer altKey=0, ctrlKey=0, keyIs keyIs = get_key_code( event ) -- unshifted lower case (usually) to understand the applied deviations keyIs1 = keyIs keyIs1 = keyIs1 + EuTestLoc -- using Hex 600 to hex 6FF for testing keyIs0 = keyIs1 - 32 -- capitals if unshifted entered keyIs2 = keyIs0 + 128 -- 3rd alphabet row (Halves or alternate of capitals ) keyIs3 = keyIs1 + 128 -- 4th alphabet row (halves or alternate of lower case) altKey = key_event_altdown(event) -- this will be 1 if true, 0 if false ctrlKey = key_event_controldown(event) -- this will be 1 if true, 0 if false if keyIs != 27 then if keyIs = 13 then msg[$] = msg[$][1..$-1] msg = append(msg,"_") elsif keyIs = WXK_F11 then -- changing keyIs1 = keyIs1 + 128 elsif keyIs = WXK_TAB then -- changing keyIs1 = keyIs1 + 128 elsif ctrlKey then -- changing keyIs1 = keyIs1 + 128 elsif altKey then -- changing keyIs1 = keyIs1 + 128 end if msg[$] = msg[$][1..$-1] & keyIs1 & "_" refresh_window( this ) else destroy( typeFrame ) end if end procedure set_event_handler( typeWin, -1, wxEVT_CHAR, routine_id("onKey"))