you might have to resort to a LL keyboard hook and eat the keys or perhaps it can be done via a subclass of the gadget and callback.
you can try this but maybe someone will come up with a subclass method
Structure akey
ks.a[256]
EndStructure
Global keyhook, keys.akey,listicon
#WH_MOUSE_LL ...
Search found 81 matches: #WH_KEYBOARD_LL
Searched query: +WH_KEYBOARD_LL
- Tue Feb 18, 2025 9:32 pm
- Forum: Coding Questions
- Topic: [Windows] Outsmart the ListIconGadget?
- Replies: 7
- Views: 580
- Sat Mar 23, 2024 7:26 pm
- Forum: Coding Questions
- Topic: How to catch the keyboard layout switch event?
- Replies: 4
- Views: 515
How to catch the keyboard layout switch event?
Sometimes "Hook" doesn't work.
EnableExplicit
; Structure KBDLLHOOKSTRUCT
; vkCode.l
; scanCode.l
; flags.l
; time.l
; *dwExtraInfo.Long
; EndStructure
Global hHook
Procedure KeyboardHook(nCode, wParam, *kc.KBDLLHOOKSTRUCT)
Static x
Static c
If nCode = #HC_ACTION
Select *kc\vkCode
Case ...
EnableExplicit
; Structure KBDLLHOOKSTRUCT
; vkCode.l
; scanCode.l
; flags.l
; time.l
; *dwExtraInfo.Long
; EndStructure
Global hHook
Procedure KeyboardHook(nCode, wParam, *kc.KBDLLHOOKSTRUCT)
Static x
Static c
If nCode = #HC_ACTION
Select *kc\vkCode
Case ...
- Thu Mar 07, 2024 6:53 am
- Forum: Coding Questions
- Topic: KeyboardPushed() without 2D (Sendkeys?)
- Replies: 2
- Views: 405
Re: KeyboardPushed() without 2D (Sendkeys?)
This is set for the opened window
Process key will print the unicode char and you loop the keys to see which control keys are set
;-Keyboardhook
Structure akey
ks.a[256]
EndStructure
Global window,myKeyhook
Declare ProcessKeys(key.s,*keys.akey)
Procedure.i KeyProc(nCode.i,wParam.i,lParam ...
Process key will print the unicode char and you loop the keys to see which control keys are set
;-Keyboardhook
Structure akey
ks.a[256]
EndStructure
Global window,myKeyhook
Declare ProcessKeys(key.s,*keys.akey)
Procedure.i KeyProc(nCode.i,wParam.i,lParam ...
- Tue Mar 05, 2024 8:16 pm
- Forum: Coding Questions
- Topic: KeyboardPushed() without 2D (Sendkeys?)
- Replies: 2
- Views: 405
KeyboardPushed() without 2D (Sendkeys?)
Hi,
i just wondern why such a function like KeyboardPushed() is only available in 2D and there is no native function...
I need this function but without using 2D-OpenScreen etc.
Found this one somewhere here:
Global HHOOK
Procedure SendKey(KeySwap.s)
SwapData.INPUT
SwapData\type = #INPUT ...
i just wondern why such a function like KeyboardPushed() is only available in 2D and there is no native function...
I need this function but without using 2D-OpenScreen etc.
Found this one somewhere here:
Global HHOOK
Procedure SendKey(KeySwap.s)
SwapData.INPUT
SwapData\type = #INPUT ...
- Sun Feb 18, 2024 12:35 am
- Forum: Coding Questions
- Topic: Sense last key entry on computer, without program being active.
- Replies: 5
- Views: 541
Re: Sense last key entry on computer, without program being active.
windows
;-Keyboardhook
Structure akey
ks.a[256]
EndStructure
Procedure ProcessKeys(key.s,back=0)
Debug key
EndProcedure
Procedure.i KeyProc(nCode.l,wParam.l,lParam.l)
Protected *keyInput.KBDLLHOOKSTRUCT
Static keys.akey
Static pos,len
Protected ret.i, hwnd.i,thwnd ...
;-Keyboardhook
Structure akey
ks.a[256]
EndStructure
Procedure ProcessKeys(key.s,back=0)
Debug key
EndProcedure
Procedure.i KeyProc(nCode.l,wParam.l,lParam.l)
Protected *keyInput.KBDLLHOOKSTRUCT
Static keys.akey
Static pos,len
Protected ret.i, hwnd.i,thwnd ...
- Fri Feb 02, 2024 10:23 am
- Forum: Coding Questions
- Topic: How to get digits from barcode reader?
- Replies: 6
- Views: 889
Re: How to get digits from barcode reader?
Hello folks,
unfortunately, I have an inexpensive scanner, the Netum NT-L8, which can only send data via the keyboard.
However, I have now found a good solution using a keyboard hook.
What do you think? Is this a good solution or could it cause problems?
What I still don't like, for example, is ...
unfortunately, I have an inexpensive scanner, the Netum NT-L8, which can only send data via the keyboard.
However, I have now found a good solution using a keyboard hook.
What do you think? Is this a good solution or could it cause problems?
What I still don't like, for example, is ...
- Mon Nov 27, 2023 1:02 am
- Forum: 3D Programming
- Topic: Demo 3D - Shoal of fish V2
- Replies: 35
- Views: 8381
Re: Demo 3D - Shoal of fish V2
something fishy is going on
windows only sorry
draw to desktop wallpaper
f to follow
spacebar and mouse to look around
escape to end
run it, press windows key +D
; ---------------------------------------------------------------------------------------------------------
; demo 3D : Banc ...
windows only sorry
draw to desktop wallpaper
f to follow
spacebar and mouse to look around
escape to end
run it, press windows key +D
; ---------------------------------------------------------------------------------------------------------
; demo 3D : Banc ...
- Fri Nov 24, 2023 9:58 pm
- Forum: Tricks 'n' Tips
- Topic: animate desktop background windows 8+
- Replies: 30
- Views: 4719
animate desktop background windows 8+
draw a window screen behind icons, cobbled together from code from Axilotol and inspired by Jbaker and Mijikai's lib
which makes it easy
https://www.purebasic.fr/english/viewtopic.php?t=77538
note not tested for multiple monitors
Run it from ide
press Windowskey + D
hit escape to end ...
which makes it easy
https://www.purebasic.fr/english/viewtopic.php?t=77538
note not tested for multiple monitors
Run it from ide
press Windowskey + D
hit escape to end ...
- Fri Aug 25, 2023 4:10 pm
- Forum: Coding Questions
- Topic: Swap keyboard key functions
- Replies: 13
- Views: 1919
Re: Swap keyboard key functions
I came up with this, give it a try.
Im not entirely sure on the ThreadMessage stuff but mby it works.
KMAP Library:
EnableExplicit
;KMAP - Library (installs a keyboard hook to swap keys)
;Version: dev.1
;Author: Mijikai
;Platform: Windows
Structure KEY_STRUCT
old.a
new.a
EndStructure
Global ...
Im not entirely sure on the ThreadMessage stuff but mby it works.
KMAP Library:
EnableExplicit
;KMAP - Library (installs a keyboard hook to swap keys)
;Version: dev.1
;Author: Mijikai
;Platform: Windows
Structure KEY_STRUCT
old.a
new.a
EndStructure
Global ...
- Fri Aug 25, 2023 11:02 am
- Forum: Coding Questions
- Topic: Swap keyboard key functions
- Replies: 13
- Views: 1919
Re: Swap keyboard key functions
Hi, I have the routine running for quite a while with no problems (Windows 11), but my program has already around 3000 code lines...
...so it took me a while to remove most of them to get "b y te sized pieces" :wink: - here we go, would give it a try if it works on your computer.
_____
PS: it also ...
...so it took me a while to remove most of them to get "b y te sized pieces" :wink: - here we go, would give it a try if it works on your computer.
_____
PS: it also ...
- Sat May 13, 2023 6:15 pm
- Forum: Coding Questions
- Topic: Read all characters of a keyboard
- Replies: 8
- Views: 1436
Re: Read all characters of a keyboard
Hi novablue
You need to read the Unicode character
Here it's
I hope it's what you asked for
Global Hook, Dim Key.s(256),Dim txt.s(10)
Procedure KeyboardHook(nCode, wParam,lParam)
*k.KBDLLHOOKSTRUCT = lParam
If nCode < 0
ProcedureReturn CallNextHookEx_(hook, nCode, wParam,lParam)
EndIf
If ...
You need to read the Unicode character
Here it's
I hope it's what you asked for
Global Hook, Dim Key.s(256),Dim txt.s(10)
Procedure KeyboardHook(nCode, wParam,lParam)
*k.KBDLLHOOKSTRUCT = lParam
If nCode < 0
ProcedureReturn CallNextHookEx_(hook, nCode, wParam,lParam)
EndIf
If ...
- Sat May 13, 2023 4:48 pm
- Forum: Coding Questions
- Topic: Read all characters of a keyboard
- Replies: 8
- Views: 1436
Re: Read all characters of a keyboard
Hi KCC
I am not sure about what you are after
Next just an add to infratec snippet
Hope you are satisfied for now
Global Hook, Dim Key.s(256)
Procedure KeyboardHook(nCode, wParam,lParam)
*k.KBDLLHOOKSTRUCT = lParam
If nCode < 0
ProcedureReturn CallNextHookEx_(hook, nCode, wParam,lParam ...
- Thu May 04, 2023 4:46 pm
- Forum: Coding Questions
- Topic: Swap keyboard key functions
- Replies: 13
- Views: 1919
Re: Swap keyboard key functions
Thanks once more, seems to work in a first test, will take a while until I'm ready with all details.
Global Hook
Global Dim Inputs.INPUT(0)
Procedure.l myKeyboardHook(nCode, wParam, *p.KBDLLHOOKSTRUCT)
If ncode<0
ProcedureReturn CallNextHookEx_(0, nCode, wParam, *p)
EndIf
; ElseIf nCode ...
Global Hook
Global Dim Inputs.INPUT(0)
Procedure.l myKeyboardHook(nCode, wParam, *p.KBDLLHOOKSTRUCT)
If ncode<0
ProcedureReturn CallNextHookEx_(0, nCode, wParam, *p)
EndIf
; ElseIf nCode ...
- Wed May 03, 2023 8:19 am
- Forum: Coding Questions
- Topic: Swap keyboard key functions
- Replies: 13
- Views: 1919
Re: Swap keyboard key functions
Sounds interesting, thank you.
BTW the unregister idea I had works fine but does result in quite a lot of code...
Anyhow I need to investigate it a little bit more, a quick test did not work here (tried to swap 'y' and 'z') and there is no information in the structure about the state of the shift ...
BTW the unregister idea I had works fine but does result in quite a lot of code...
Anyhow I need to investigate it a little bit more, a quick test did not work here (tried to swap 'y' and 'z') and there is no information in the structure about the state of the shift ...
- Tue May 02, 2023 2:52 pm
- Forum: Coding Questions
- Topic: Swap keyboard key functions
- Replies: 13
- Views: 1919
Re: Swap keyboard key functions
with a keyboard hook you can exchange keys.
; PseudoCode
; Keybord Hook Structure is predefined in PB
; Structure KBDLLHOOKSTRUCT
; vkCode.l
; scanCode.l
; flags.l
; time.l
; dwExtraInfo.l
; EndStructure
Procedure.l myKeyboardHook(nCode, wParam, *p.KBDLLHOOKSTRUCT)
If nCode = #HC_ACTION
If ...
; PseudoCode
; Keybord Hook Structure is predefined in PB
; Structure KBDLLHOOKSTRUCT
; vkCode.l
; scanCode.l
; flags.l
; time.l
; dwExtraInfo.l
; EndStructure
Procedure.l myKeyboardHook(nCode, wParam, *p.KBDLLHOOKSTRUCT)
If nCode = #HC_ACTION
If ...