Can I send a keypress to Windows from Emacs?

前端 未结 2 1411
孤独总比滥情好
孤独总比滥情好 2021-01-21 17:27

There is a function \'w32-toggle-lock-key to, effectively, simulate a press of capslock, numlock, or scroll-lock key. Is there a si

相关标签:
2条回答
  • 2021-01-21 18:10

    I don't think emacs can do it - you are asking for something very particular... Since you are on Windows, one thing you can try is Autohotkey, by writing a script with something like

    Send {Shift}
    

    And call the script from emacs. Warning: this is untested.

    0 讨论(0)
  • 2021-01-21 18:13

    I believe the answer is no. For the same reasons discussed in this answer, namely that shift is a modifier, and Windows is swallowing the keypress.

    The easiest way to see if Emacs responds to a key is to ask for help on a key

    C-h k <press-key>
    

    If Emacs tells you what is bound to that key, you're golden. If Emacs seems to be waiting for more input (and after about 2 seconds shows you the key in the minibuffer), then you're still good - the key is just mapped to a prefix map (e.g. ESC or C-x). If Emacs does nothing and is still waiting for you to type something at the prompt

    Describe key (or click or menu item):
    

    then you know Emacs hasn't received an event. This is what happens when I press SHIFT.

    0 讨论(0)
提交回复
热议问题