1. Disable F10 for menu bar

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

new topic     » topic index » view message » categorize

2. Re: Disable F10 for menu bar

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 ) 
new topic     » goto parent     » topic index » view message » categorize

3. Re: Disable F10 for menu bar

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() 
new topic     » goto parent     » topic index » view message » categorize

4. Re: Disable F10 for menu bar

penpal0andrew said...

Either this does not work ...

There is a bug. You can change one line in win32lib.ew to fix it.

Almost at the end of the routine fDoKeys(), locate this line

    if isDown and isSys and not shifts and wParam = VK_F10 and vSkipF10 then  

and change it to

    if (isDown and isSys and not shifts) or (wParam = VK_F10 and vSkipF10) then  
new topic     » goto parent     » topic index » view message » categorize

5. Re: Disable F10 for menu bar

DerekParnell said...
penpal0andrew said...

Either this does not work ...

There is a bug. You can change one line in win32lib.ew to fix it.

Almost at the end of the routine fDoKeys(), locate this line

    if isDown and isSys and not shifts and wParam = VK_F10 and vSkipF10 then  

and change it to

    if (isDown and isSys and not shifts) or (wParam = VK_F10 and vSkipF10) then  

Thank you. Let me know when this change is in a release number for win32lib.ew.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Disable F10 for menu bar

penpal0andrew said...

Thank you. Let me know when this change is in a release number for win32lib.ew.

Already done. See SVN#60

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu