zielmicha / emacs-android

Emacs port to Android.
141 stars 23 forks source link

can't enter some characters #1

Open hobbes opened 12 years ago

hobbes commented 12 years ago

Hi,

I just installed your emacs port for android on an asus tf101 with CM9 (ics), thanks for that. The transformer comes with a hardware keyboard, mine is Belgian. The regular android terminal works fine for all characters.

emacs starts fine and seems to work fine, but the terminal somehow borks my hardware keyboard.

Regular ascii letters work fine, ctrl and alt also, but that's about it...

The number keys directly produce numbers, whereas they should need shift in the Belgian layout. With shift, they produce special non ascii characters: !@#$%^&*() in that order.

Most other punctuation signs on the keyboard do not work: keys on the right of numbers and letters (all rows) do not produce any output.

Don't hesitate to ask for more info, I would definitely like to see this work :-)

zielmicha commented 12 years ago

Numbers: it's standard behavior on US or Polish keyboard. I didn't know that there are keyboards like this (I will change code to use data from input method).

Punctuation signs: they should work unless Ctrl or Alt is used to generate them on Belgian keyboards.

It's hard to debug a keyboard that you don't have. I even had troubles with my own Asus Transformer that for some reason refuses to produce events for some key combinations like Ctrl-Space.

hobbes commented 12 years ago

On Belgian layout (and several others), we have signs on the top row, and numbers need to be input with shift.

Punctuation signs are different on all layouts, so the input methot needs to be used for them too.

The standard android terminal works fine with my layout, so the problem is probably in one of your modifications... by the way, would it be possible to use your emacs in the standard terminal ?

Thanks

zielmicha commented 12 years ago

Input method is used for punctuation signs already, so I'm surprised that they don't work for you.

Unfortunately I can't use input method for everything - Alt/AltGr character is used as Meta and (at least polish) methods doesn't emit any characters - I have to translate keycodes manually.

Yes it's possible, but all terminal emulator I've seen have no easy way of typing "Meta" and they don't support sequences like Ctrl-Space.

This should launch emacs from other terminal:

export termuser=$(whoami)
su -m
chown -R $termuser /data/data/com.zielm.emacs
exit
cd /data/data/com.zielm.emacs
/system/bin/sh init.sh
wheineman commented 12 years ago

Same issue with US bluetooth keyboard. Don't see characters `~!@#%^&*()_+{}[]| from bluetooth keyboard. Software Hacker Keyboard works fine. Thanks for this port.

coloquio commented 12 years ago

I installed android-emacs in a samsung galaxy tab 10.1. Have no trouble using android's screen keyboard or hacker's keyboard also on the screen. However, my kensington bluetooh keyboard presents several drawbacks: the keys on the diagonals to the right of -, p, l and < are dead only in emacs. the alt/option key doesn't work either. I tried changing the language of the tablet (it's Spanish by default), which makes those keys active, but deactivates ctrl, and alt, as well as the @ sign. I'd assign keys manually, but can't figure the way to access the init file.

akrito commented 12 years ago

I experience the same problem with an Apple Bluetooth keyboard, but when I use the same keyboard with Android Terminal Emulator, all keys work fine. A clue?

zielmicha commented 12 years ago

I have modified keyboard handling to support Alt-key sequences. If think there is no clean way of handling them, because in some languages Alt is used as modifier key for producing accents.

SorraTheOrc commented 12 years ago

These issues seem really inconsistent. On Samsung Galaxy Note 10.1 the native keyboard works fine for all (most?) punctuation. The Hacker keyboard fails on some (e.g. *). My hardware bluetooth fails on others (e.g. ".").

All keyboards seem to work fine in other applications.

coloquio commented 12 years ago

Thanks for the update. In fact, now the alt-key works properly but the ctrl key is dead in my kensington bluetooth keyboard. Sad because every other key is working. I also tried to assign ctrl to other keys from the preferences menu, but it didn't work for me.

vicdavery commented 11 years ago

+1 for this bug on a Asus Transformer Prime Infinity (TF700) with hardware UK keyboard. No modifications from new running Jellybean. None of the punctuation/symbol keys down the right hand side of the keyboard work: -_+={}[]:;@'#~<>,./? Unfortunately trying to program in C++ is going to be a bit tricky. :)

BTW, these keys all work in Terminal Emulator and Terminal IDE

zielmicha commented 11 years ago

I'm going to get TF700 this week, so I will investigate.

Micha³ Zieliñski 6 lis 2012 10:42, "vicdavery" notifications@github.com napisa³(a):

+1 for this bug on a Asus Transformer Prime Infinity (TF700) with hardware UK keyboard. No modifications from new running Jellybean. None of the punctuation/symbol keys down the right hand side of the keyboard work: -_+={}[]:;@'#~<>,./? Unfortunately trying to program in C++ is going to be a bit tricky. :)

Reply to this email directly or view it on GitHubhttps://github.com/zielmicha/emacs-android/issues/1#issuecomment-10104338.

vicdavery commented 11 years ago

Nice one, thanks for responding. I really like the TF700, a great little unit.

Michał Zieliński notifications@github.com wrote:

I'm going to get TF700 this week, so I will investigate.

Micha³ Zieliñski 6 lis 2012 10:42, "vicdavery" notifications@github.com napisa³(a):

+1 for this bug on a Asus Transformer Prime Infinity (TF700) with hardware UK keyboard. No modifications from new running Jellybean. None of the punctuation/symbol keys down the right hand side of the keyboard work: -_+={}[]:;@'#~<>,./? Unfortunately trying to program in C++ is going to be a bit tricky. :)

Reply to this email directly or view it on GitHubhttps://github.com/zielmicha/emacs-android/issues/1#issuecomment-10104338.

— Reply to this email directly or view it on GitHub.

ricardodg commented 11 years ago

Any progress with the tf700 keyboard? It would be very useful for me -- emacs is great to have, but it is a little bit frustrating not to be able to really use it.

eichin commented 11 years ago

Do you want new device bugs, or should we just pile on here? Just picked up an Asus TF300T with keyboard(+battery) dock on woot, and the dock-keyboard fails to generate anything for the punctuation keys. (Letters are fine - ^x^s and ^x^c are also fine, shift-numbers are fine, it's just actual punctuation keys: .,/;'`[]-= get no reaction at all - in emacs itself, or if I ^x^c out of it, from the shell that's left behind...)

juan-g commented 11 years ago

A possible workaround for hardware keyboards (bluetooth, usb...), from a user review of this Emacs for Android app on Google Play (September 8, 2012 - Version 1.0.1):

The keyboard issues others have mentioned disappear when I use External Keyboard Helper Pro. Non-alphanumeric keys, CTRL, ALT and function keys all seem to be fine (perixx PERIBOARD-804).

eichin commented 11 years ago

Nice! I just tried "External Keyboard Helper Pro" on the Asus Transformer TF300T mentioned above, and the punctuation all works. I don't know if that leads to anything useful towards fixing it from within Emacs.app, but it means I can start using it and looking into more interesting problems :-)

tigerhawkvok commented 11 years ago

Same problem occurs with the TF201 en-US keyboard. Any luck debugging this?

juan-g commented 11 years ago

Does the workaround (External Keyboard Helper Pro app) fix it for you?

tigerhawkvok commented 11 years ago

it does, but I was mostly posting for error-tracking edification ;-)

juan-g commented 11 years ago

tigerhawkvok, in the user reviews (Google Play) there is one yesterday also with the TF201, saying "I'd love to see the ability to put in your own startup file!" Maybe it's your comment. In this case, I tested adding an init file, an it works. It's:

/sdcard/emacs/.emacs

vicdavery commented 11 years ago

I've only tried the demo of External Keyboard Helper Pro, but it doesn't fix the problem for me with a TF700T I'm afraid. Is it only the full version that works? The blurb for the demo said it just replaced the space bar with other characters.

BTW, the full version seems to have disappeared from the play store now too. :(

On Mon, Jan 7, 2013 at 11:27 PM, juan-g notifications@github.com wrote:

tigerhawkvok, in the user reviews (Google Play) there is one yesterday also with the TF201, saying "I'd love to see the ability to put in your own startup file!". Maybe it's your comment. In this case, I tested adding an init file, an it works. It's:

/sdcard/emacs/.emacs

— Reply to this email directly or view it on GitHubhttps://github.com/zielmicha/emacs-android/issues/1#issuecomment-11977423.

coloquio commented 11 years ago

same here, the External Keyboard helper didn't work w/ kensington bluethooth keyboard on a Galaxy 10.1 tablet

however, I was able to introduce punctuation signs from the external keyboard for a minute or so, while the keyboard was bluetooth connected and the system had not recognized it; I've tried unsuccessfully to disable all tablet's input modes and see if plain bluetooth connection fixes the issue.

juan-g commented 11 years ago

BTW, the full version seems to have disappeared from the play store now too. :(

It seems the Pro version (External Keyboard Helper Pro) is again available.

They say: "It does not automatically switch Input Method. It only shows the dialog and you will have to choose Input Method manually. This is an intentional limitation built into Android by Google. No app is allowed to change Input Method without user interaction (unless the app is a system app)."

And, about the Demo version, they say: "Everything works just like in the Pro version except for the Space button which prints a message that this is a demo version."

coloquio commented 11 years ago

These guys here http://code.google.com/p/connectbot/issues/detail?id=369 have been discussing for months the same issue of this thread --i.e. dead-keys in external keyboards for android devices. From comment 73 on some different approaches provide solutions for the mapping of dead keys, one of them remapping from busybox (comment 79) --don't know if the terminal emulator in android-emacs allows doing this. I wonder if some of these approaches would be useful to get the ctrl key working in emacs. My hunch is that the problem is on the android-emacs end because it somehow overrides interface with the native system key-mapping.

lngndvs commented 10 years ago

A year later. On both a Samsung Galaxy S4 and a Nexus 7 tablet, USB keyboards had not worked with punctuation characters, on Emacs. Having now installed External Keyboard Helper Pro, at least the "." key now works; however, it is necessary to manually change the input method as mentioned above. I think there may be other glitches with Alt-modified characters. For now I am pleased to find this thread, and that some solutions have been found. Hooray!!!

One is curious what could be the underlying issue. Perhaps something unique in the keyboard mapping of Emacs? Would the bash shell make a difference?

I can type on my tablet and phone with a physical keyboard.

ivanperez-keera commented 10 years ago

I was trying to type a * (as in shift 8) for a heading in org-mode, and the only way I could get it to work is by using Fn and the numeric pad's * symbol.

I'm using the on-screen hackers keyboard with US layout.

xenogenesi commented 9 years ago

I'm using an external bluetooth keyboard but only few keys are working within emacs, Ctrl Alt Shift 0-9 a-z space, any other key doesn't work (no symbols... no accent).

I've tried External Keyboard Helper Demo, itself does work, it auto detect the layout correctly and the debug option show the keyboard id and scan codes for each key correctly, but it doesn't work within emacs.

Any suggestion?