Is there a function that maps a keyboard input character to the character that would have been input if the shift key modifier was being pressed? For instance if I pass the input ?c it would return ?C, or if I pass the input ?2 it would return ?@.
1 Answer
You can probably do it with the function event-apply-shift-modifier
. But it will depend on exactly what you're using it for (of course).
-
1
event-apply-shift-modifier
reads an event, it doesn't take an event or a character as argument. You'd need to callevent-apply-modifier
directly. But that wouldn't do what the asker wants: it uppercases ASCII letters, but you can easily do that manually anyway. Other characters (non-ASCII letters, non-letters) are mapped to events with the shift bit set, not to a different base character. Jun 1, 2022 at 18:59
@
(as used in the US) or"
(which is used on some european layouts).