Re: Disable F10 for menu bar
- Posted by penpal0andrew Jun 29, 2009
- 1131 views
DerekParnell said...
penpal0andrew said...
My application does not use menus, so I want to use F10 for my program. Is there any way to over ride the default Windows behavior. When I googled this, I found out that this F10 behavior is done in Linux as well. But I want the solution for MS Windows as supported by Euphoria.
Thanks. A. Katz
If you are using win32lib you can call ...
integer PrevF10Flag PrevF10Flag = skipF10( w32True )
Either this does not work, or I am using it wrong, or it does not apply to my situation. Here is test code which is how my program uses the keys. If you press F10 it will work every other time. And it disables F9 every other time.
without warning include win32lib.ew integer win, text9, text10, count9, count10 procedure Screen_keydown(integer Self, integer Event, sequence Params) -- Application hot key detector if Params[1] = VK_F9 then count9 += 1 setText(text9, sprintf("F9 pressed %d times",{count9})) elsif Params[1] = VK_F10 then VOID = skipF10( w32True ) count10 += 1 setText(text10, sprintf("F10 pressed %d times",{count10})) end if end procedure setHandler(Screen, w32HKeyDown, routine_id("Screen_keydown")) procedure main() count9 = 0 count10 = 0 win = createEx(Window, "Test F10 control", 0, 0, 0, 400, 200, 0, 0) text9 = createEx( LText, "F9 pressed 0 times", win, 4, 70, 120, 20, 0, 0 ) text10 = createEx( LText, "F10 pressed 0 times", win, 4, 100, 120, 20, 0, 0 ) WinMain(win, Normal) end procedure main()