2

There is a function 'w32-toggle-lock-key to, effectively, simulate a press of capslock, numlock, or scroll-lock key. Is there a similar function to simulate a shift key by itself (not shift+something else)?

The reason I need this is because I have shift bound to switch languages in Windows.

Trey Jackson
  • 73,529
  • 11
  • 197
  • 229
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487

2 Answers2

4

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.

Community
  • 1
  • 1
Trey Jackson
  • 73,529
  • 11
  • 197
  • 229
1

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.

polyglot
  • 9,945
  • 10
  • 49
  • 63