Closed brightertools closed 11 months ago
I found the code:
var simulator = new EventSimulator(); simulator.SimulateKeyPress(SharpHook.Native.KeyCode.VcLeftMeta); simulator.SimulateKeyPress(SharpHook.Native.KeyCode.VcPeriod);
This does open the emoji window on windows (I do seem to need to set the focus on the test box) and its seems to work however when I close the box my computer stil thinks I am pressing the windows key
ok got it, sorry
The actions are press then release, so this works
var simulator = new EventSimulator(); simulator.SimulateKeyPress(KeyCode.VcLeftMeta); simulator.SimulateKeyPress(KeyCode.VcPeriod); simulator.SimulateKeyRelease(KeyCode.VcLeftMeta); simulator.SimulateKeyRelease(KeyCode.VcPeriod);
Hi! Thanks for posting this question! And I'm glad you've figured it out before I even saw the question :)
Yes, the VcLeftMeta
and VcRightMeta
key codes represent different keys on different platforms:
Win
keysCommand
keysSuper
or Meta
keysAnd yes, you need to explicitly simulate pressing and the releasing keys. I would recommend releasing the keys in the reverse order as I think it's the way we do that naturally - for example, when pressing Ctrl+C
, you press Ctrl
, then press C
, then release C
, and finally, release Ctrl
. But if it works, you can leave it either way.
Also, here's the list of key code mappings for each platform.
I am trying to emulate pressing the windows + . (dot) to get the Windows Emoji Keyboard.
I just cannot seem to see it..
also the command key on MacOS, to do the same thing with Command + Control + Space