Giter Club home page Giter Club logo

Comments (3)

tig avatar tig commented on August 24, 2024

From the docs:

Sending a single character without the chars: command (e.g. just c) is equivalent to a SendInput command defined as (see below). In other words, sending a single character is the same as a single key press of a key on the keyboard. For example sending a will result in the A key being pressed. 1 will result in the 1 key being pressed. There is no difference between sending a and A. Use shiftdown:/shiftup: to simulate the pressing of the shift, control, alt, and windows keys.

IOW, if you just send a single char, MCE Controller tries to map that char to a VK_ code. Hence backtick gets translated into the VK code for 0x60 (VK_NUMPAD0), not it's actually VK code (which is VK_OEM_3).

See: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

If you want to send non-alpha chars, you can either:

  • Embed them in a chars: command (e.g. "chars:`").

or

  • Send VK_OEM3

or

  • Define and use a SendInput command with the VK code for the the tick key (VK_OEM3): <SendInput cmd="sendtick" vk="VK_OEM3" Enabled="True"/> or <SendInput cmd="sendtick" vk="0xC0" Enabled="True"/>

Please let me know if you still are having trouble. Happy to tweak it to make it work for you.

from mcec.

hotelfoxtrotnovember avatar hotelfoxtrotnovember commented on August 24, 2024

Thank you so much for the explanation. Now that I've connected one missing dot, I believe I understand what's going on. Just for the benefit of anyone else looking at this in the future, the dot I was missing is that the ascii byte value for the backtick character is 0x60, which is what I was sending over the connection and that is why it then got mapped to the VK_NUMPAD0 code (which is value 0x60). I'm not particularly familiar with keyboard layout/region mapping stuff so I just incorrectly assumed the non-alphanumeric characters worked the same as the alphanumeric ones and that the key mappings were the same as well.

Now that I have a clearer picture of what is going on, I should be able to make things work with "chars:". One last thing I just discovered, that again may or may not be a bug, is that "chars:" followed by a single backslash character results in typing 0 characters. I suspect that is because the single backslash is being treated as an escape character? However, since "chars:" uses literal values, does having an escape character make sense? All the other non-alphanumeric characters I tried worked fine with "chars:" (including the ones that typically need an escape character) and "chars:" with two backslashes does type a single backslash. Just wanted to confirm this was intentional behavior.

That's kind of a long-winded way to say I think I've got everything I need and thank you again for your help with this!

from mcec.

tig avatar tig commented on August 24, 2024

chars: supports escaped characters, and thus chars:\ is invalid. To send a \ you need to do chars:\\. I should log when this happens and fix the docs.

Thanks.

from mcec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.