1

I regularly use the backspace key to delete whole words at a time to the left of the cursor, but this would be a MUCH easier keystroke if it could be done one-handed. For that to happen - I would need to use the right key. But when I do this from EMACS' response it is clearly interpreting this key as being different form the left key.

In this answer the poster identifies a method to achieve this outcome of changing the keymap: https://stackoverflow.com/questions/10257352/right-alt-key-not-working-as-meta-key-in-emacs

I would like to do this by "tweaking" emacs rather than change my keymap in the OS.

Does anybody know how to tell emacs that right alt is the same as left alt?

I am using Windows 10 as my OS

I am accessing EMACS through PUTTY: Release 0.70

onto a Red Hat Enterprise Linux Workstation release 7.6 (Maipo)

EMACS Version: GNU Emacs 24.3.1

This is on my Universities linux Lab - so I am not likely to have a lot of ability to edit config files for EMACS either...

kiltannen
  • 111
  • 4
  • If Emacs thinks right-alt and left-alt are different, it means the OS passes different information to Emacs depending on which one you use. How to change how Emacs reacts, and whether it is at all possible to do what you want, depends on exactly what the OS is doing. So: what operating system is this? What keyboard layout and settings? And what version of Emacs? – Gilles 'SO- stop being evil' Feb 06 '19 at 17:52
  • You can get the version with `M-x emacs-version`. – NickD Feb 07 '19 at 01:41
  • @NickD - Thx - I'e edited in the EMACS & Red Hat versions as well. – kiltannen Feb 07 '19 at 02:21
  • This isn't normal. Some more info would help. First: if the `xev` program is available on your RedHat computer, run it in a terminal and see what keycode the OS provides for the right and left alt keys. For me I see `Alt_R` and `Alt_L`. Then check to see what key codes are passed to Emacs when you press those keys: `C-h k M-backspace`, using the right and left keys for `M`. – Tyler Feb 07 '19 at 17:25
  • @Tyler sadly I couldn't get xev. When I followed emacs commands you suggested - I could see the alt_L BUT the right Alt gave nothing at all! I am suspecting a slightly nonstandard scan code that is not being interpreted at all by Emacs :(( So I ended up using keytweak and remapping the key. Not my 1st or even 2nd preference - but it's what got it to work in the end. – kiltannen Feb 19 '19 at 09:55

2 Answers2

2

in init.el,

(setq w32-recognize-altgr nil)

Please find it in G.6 Keyboard Usage on MS-Windows (https://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-Keyboard.html)

Best Wish, SY

Stefan
  • 26,154
  • 3
  • 46
  • 84
steven y.
  • 21
  • 2
0

for fedora (34+), at least, the incantation is:

  • settings .. keyboard
  • special characters entry .. alternate characters key default is right alt.
    change it to something else, maybe something you don't have, like right super.

.. unless you need to type some fancy characters... :-)

Andy
  • 1