Hotkeys and key events

Archives Forums/MaxGUI Bug Reports/Hotkeys and key events

JoshK(Posted 2009) [#1]
I think a hotkey should not trigger a keydown event. Right now I have WASD controls in the editor that detect keydown events. When I press Ctrl+S to save a file, a keydown event is emitted with the S key, but the keyup event never occurs because a file requester is opened.

This is one problem, but it makes sense to me in general for hotkeys to not emit keydown events. In this example Ctrl+S would result in no keydown event, but the S key on its own would.


JoshK(Posted 2009) [#2]
Another problem is Ctrl+S to save in my script editor opens a file requester, and when the file requester closes, an S character appears in the Scintilla gadget. Not sure if this occurs in the text area gadget as well.


SebHoll(Posted 2009) [#3]
Hmmm... I remember changing this behaviour recently in order to settle a previous bug report.

Try uncommenting line 516 of TWindowsGUIDriver.KeyboardProc(), i.e.
...
			If ev
				'Hot-key events shouldn't be emitted if the source gadget is disabled
				If Not(TGadget(ev.source) And GadgetDisabled(TGadget(ev.source))) Then
					If Not (lparam & $80000000) EmitEvent ev
					Return 1	'Key press events never reach active panels etc. if we return 1
				EndIf
			EndIf
...
...and then building modules.


SebHoll(Posted 2009) [#4]
Kk, in MaxGUI 1.35, the default is to suppress any hotkey presses that involve a modifier.

Please let me know how this is for you, Josh.


JoshK(Posted 2009) [#5]
Doesn't seem to have any effect. I'll have to make an example.


SebHoll(Posted 2009) [#6]
Josh, I'll be getting MaxGUI 1.36 out in the next day or so, so if you could post an example before then, I'll make sure I look into this before release.