tags:

views:

157

answers:

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.

+3  A: 

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.

Trey Jackson
Thank you. Does the same apply to `<language-change>` (which Emacs treats like a key)?
Alexey Romanov
+1  A: 

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
Yes, this _is_ a possibility.
Alexey Romanov