Why Keys blocked?
Why Keys blocked?
ExamineKeyboard()
If KeyboardPushed(#PB_Key_A):....:EndIf
after return from the subroutine which uses this kind of control, the keyboard did not work anymore in the ExplorerTreeGadged, String Gadget and probably other gadgets too. I can then use mouse only to select files/text. ExamineKeyboard() itself is harmless, but KeyboardPushed()/KeyboardReleased() blocks the complete keyboard input to the gadgets. Is there a way to unblock keyboard, so the keys will work again with windows gadgets, or is it a bug?
If KeyboardPushed(#PB_Key_A):....:EndIf
after return from the subroutine which uses this kind of control, the keyboard did not work anymore in the ExplorerTreeGadged, String Gadget and probably other gadgets too. I can then use mouse only to select files/text. ExamineKeyboard() itself is harmless, but KeyboardPushed()/KeyboardReleased() blocks the complete keyboard input to the gadgets. Is there a way to unblock keyboard, so the keys will work again with windows gadgets, or is it a bug?
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
I'm not sure about using the keyboard lib in an application... This is one way to check for enter being pressed :
.. It should work for any key.. Most would suggest using AddKeyboardShortcut() though as it's a bit more reliable...
Code: Select all
Select MyEventID
Case #WM_KEYDOWN
If EventwParam() = 13
Select EventGadgetID()
Case #String_Gadget_Here
Debug "Return key pressed in string gadget"
EndSelect
EndIf
EndSelect -Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Code: Select all
InitKeyboard()
ExamineKeyboard()
If KeyboardPushed(#PB_Key_A):....:EndIf
etc...
You could maybe use a CallBack or shortcuts as Karbon said.
I use the DX7 keyboard control to control the scrolling in zoom mode of my application, and it is working in windowed screen mode.
Shortcuts for scrolling is a bit unusual, but I will test the other method tomorrow. Any idea why it blocks gadgets?
Shortcuts for scrolling is a bit unusual, but I will test the other method tomorrow. Any idea why it blocks gadgets?
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
Check win32 API, for virtual key codes:
You probably don't have to define the constants though as they're probably already available in PB.
Code: Select all
#VK_LEFT = 25 ;LEFT ARROW key
#VK_UP =26 ;UP ARROW key
#VK_RIGHT = 27 ;RIGHT ARROW key
VK_DOWN = 28 ;DOWN ARROW key
Thx, Pupil, it works fine, except the CHR codes are wrong, for example #VK_DOWN is the constant for 40 (probably because I'm damned to use a german keyboard?), but it works with these constants. Excellent. I guess, I can now throw out all DX keyboard command. Still no idea why it kills API input? (Don´t says because these are Micro$oft products) 
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
This is a total guess but if you use the DX keyboard controls then the app is handing over all control of the keyboard to DX?
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
@Pupil: Eh, Hex... I see. Should figure this out next time. I do not care about how you write hex (0xFF or $FF for 255).
@Karbon: But after the DX handling is over, should it not hand over the keyboard controls to the app? If it sounds like a bug, it is probably a bug. I´m just curious what Fred says about this.
@Karbon: But after the DX handling is over, should it not hand over the keyboard controls to the app? If it sounds like a bug, it is probably a bug. I´m just curious what Fred says about this.
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10



