bjoern
September 17, 2022, 7:03pm
#1
A global mouse and keyboard hook for vvvv gamma. In contrast to the GlobalHook stuff posted in the forum and the chat beforehand this package is not based on MouseKeyHook but on SharpHook by Tolik Pylypchuk .
After some deliberation I chose Sharphook because:
For more info please check:
https://sharphook.tolik.io/v3.1.1/articles/intro.html
To use latest version, install via nuget
nuget install VL.IO.MouseKeyGlobal
Edit:
Latest version (1.3.0) supports keyboard simulation.
9 Likes
chk
September 17, 2022, 7:43pm
#2
I gave it a go and a lot of nodes are red over here, am I missing something?
bjoern
September 17, 2022, 7:47pm
#3
Forgot to add the dependency on SharpHook to the nuspec… Should be fixed with the upcoming version. For now you have to install the dependency manually.
Hi bjoern,
thanks for your contrib! I am patching a touch keyboard, but I am struggling with @ and space
Rcontrol+Alt+Q just gives me “q” s. I also tried LControl and Control - same.
also funny: Shift+OemMinus does not work, but LShiftKey+OemMinus does.
And “Space” does not work at all for me.
Any hints? It seemed to me you already did something similar :)
bjoern
April 28, 2023, 3:38pm
#5
Works here:
Edit: The bang doesn’t register in the gif but is also working.
hm seems the issue lies with my typewriter mod. your contrib works for the original one, if the window is selected…
Only change I made was inputting the observables from keyboard (io.global) directly into the sampler.
other keys not working: ´´^²³{[]}~|
QWERTZ here, so basically all AltGr combinations and some other ones.
any Idea why this could happen? my physical keyboard and keyboard simulator result in the same “keypresses”
Can’t tell from looking at screenshots.
I also changed the categories of my typewriter mod for it to not interfere with the original one.
test.zip (129.1 KB)
Looks like Sharphook (or most likely rather the underlying libuiohook ) is returning the key events in the “wrong” order.
Hey, thx for having a look at it!
I suspected something like this, but I just checked with the global.io.keyboardstate for both keyboard and global hook simulator input. Your keyboardstate shows the same key order for both input methods.
Comparing system.keyboardstate with global.io.keyboardstate shows the reverse keypress order coming from the keyboard simulator… I tried inputting the reverse order, but it did not solve the problem.
Did you manage to do triple keypresses?
bjoern
May 4, 2023, 9:43pm
#11
Dug a bit deeper and turns out I was looking in the wrong place. Unfortunately there is nothing I can do about the issue. But you can work around it by using a non-german keyboard layout :)
opened 06:58PM - 04 May 23 UTC
bug
libuiohook issue
Hello again,
it appears when I opened [the last issue ](https://github.com/To… likPylypchuk/SharpHook/issues/45)I made some wrong assumptions and therefore looked in the wrong place.
The console output you posted pointed me in the right direction I think.
So when pressing (and releasing) `AltGr+Q` to get `@` the following events occur:
```
UioHookEvent: Type = KeyPressed; Time = 1683224417448; Mask = LeftCtrl; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcLeftControl; RawCode = 162; KeyChar =
UioHookEvent: Type = KeyPressed; Time = 1683224417449; Mask = LeftCtrl, RightAlt; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcRightAlt; RawCode = 165; KeyChar =
UioHookEvent: Type = KeyPressed; Time = 1683224417560; Mask = LeftCtrl, RightAlt; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcQ; RawCode = 81; KeyChar =
UioHookEvent: Type = KeyReleased; Time = 1683224417616; Mask = RightAlt; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcLeftControl; RawCode = 162; KeyChar =
UioHookEvent: Type = KeyReleased; Time = 1683224417616; Mask = None; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcRightAlt; RawCode = 165; KeyChar =
UioHookEvent: Type = KeyReleased; Time = 1683224417664; Mask = None; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcQ; RawCode = 81; KeyChar =
```
As you can see no `KeyTyped` event is raised for `Q`.
Second try was `AltGr+E` ( `€`) also with a german layout, same behaviour:
```
UioHookEvent: Type = KeyPressed; Time = 1683225653859; Mask = LeftCtrl; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcLeftControl; RawCode = 162; KeyChar =
UioHookEvent: Type = KeyPressed; Time = 1683225653859; Mask = LeftCtrl, RightAlt; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcRightAlt; RawCode = 165; KeyChar =
UioHookEvent: Type = KeyPressed; Time = 1683225653955; Mask = LeftCtrl, RightAlt; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcE; RawCode = 69; KeyChar =
UioHookEvent: Type = KeyReleased; Time = 1683225654019; Mask = RightAlt; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcLeftControl; RawCode = 162; KeyChar =
UioHookEvent: Type = KeyReleased; Time = 1683225654019; Mask = None; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcRightAlt; RawCode = 165; KeyChar =
UioHookEvent: Type = KeyReleased; Time = 1683225654035; Mask = None; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcE; RawCode = 69; KeyChar =
```
After that I tried `AltGr+ò` to get `@` with an [italien layout ](https://learn.microsoft.com/en-us/globalization/keyboards/kbdit) and it works:
```
UioHookEvent: Type = KeyPressed; Time = 1683226452760; Mask = LeftCtrl; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcLeftControl; RawCode = 162; KeyChar =
UioHookEvent: Type = KeyPressed; Time = 1683226452760; Mask = LeftCtrl, RightAlt; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcRightAlt; RawCode = 165; KeyChar =
UioHookEvent: Type = KeyPressed; Time = 1683226452881; Mask = LeftCtrl, RightAlt; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcBackquote; RawCode = 192; KeyChar =
UioHookEvent: Type = KeyTyped; Time = 1683226452881; Mask = LeftCtrl, RightAlt; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcUndefined; RawCode = 192; KeyChar = @
UioHookEvent: Type = KeyReleased; Time = 1683226452969; Mask = RightAlt; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcLeftControl; RawCode = 162; KeyChar =
UioHookEvent: Type = KeyReleased; Time = 1683226452969; Mask = None; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcRightAlt; RawCode = 165; KeyChar =
UioHookEvent: Type = KeyReleased; Time = 1683226452993; Mask = None; Reserved = None; Keyboard = KeyboardEventData: KeyCode = VcBackquote; RawCode = 192; KeyChar =
```
Could you maybe try your sample app with a [german layout](https://learn.microsoft.com/en-us/globalization/keyboards/kbdgr) ?
TIA
lol, the best error for my task at hand ^^
hey, thanks a lot for investigating and opening up the issue!