Open ryanobjc opened 8 years ago
ps, the termux project got the behavior correct, so perhaps could emulate the same code :-)
In console mode, if you set in preferences "Alt key sends escape", then the alt key will send an escape sequences, which will do the right thing for emacs. The bad news is that this also grabs the "..." key (this is the "meta" key to the right of the keyboard) and this will cause "..."+p to send escape-p instead of sending the curly brace character. (The handling of the "..." chords is done by the Android system, not by the terminal emulator).
By default, TermUX has the alt key (to the left of the spacebar) send an escape sequences, so meta-x sends escape-x, but it doesn't grab the "..." key (to the right of the spacebar) so the Android system can interpret the "..." chord characters so you can enter the curly and square braces, backslash and pipe characters. So yes, if GNURoot could emulate the TermUX behaviour that would be great, but actually GNURoot is almost there except for the "please ignore the ... key part".
If you have installed X, it looks like the alt-key is getting mapped to mod4 (mode switch, sometimes known as "Alt" or "AltGR") modifier, instead of how on most PC keyboards, the alt key gets mapped to mod1 ("Meta") modifier. You can see this because when you fire up emacs in X mode, and you type "Alt-X", it will say, "no binding for A-x", so it's not interpreting it as M-x. You can work around this using xmodmap, but it requires being a bit of a X windows expert to do this. (I tested and saw the same behavior both with a Nexus 9 and its keyboard, as well as the Pixel C and its keyboard, and a Pixel C attached to a Thinkpad Bluetooth keyboard). In X mode, it's treating the "Alt" key as an "AltGR" instead of a "Meta" key, which might be the right thing for some international keyboard setups, but it's certainly not what most people using a US-style keyboard would expect.
On the pixel c tablet, the 'alt' key summons the emoji keyboard in text fields.
They keyboard also omits the 'esc' key which is annoying. there's a 2-key stroke to enter escape, but, two strokes.
It'd be nice if the alt key provided the 'mod' key that emacs requires.