keithchan1218 / nethack-android

Automatically exported from code.google.com/p/nethack-android
0 stars 0 forks source link

Funky alt keybindings for hard kb devices #57

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Start up a game
2. Attempt to use a Nethack alt-key combo
3.

What is the expected output? What do you see instead?
The behavior of the alt keybinding is either poorly worded and/or broken. The 
easiest way to explain this is that the existing alt keys on hard keys are used 
to access alternate characters. Thus, there needs to be a way to map one alt 
key to act as a "hard keyboard alt" and one to act as a "Nethack alt key". 
Unfortunately, no option in the keybind list will make either alt key act as a 
"Nethack alt key".

E.g.: on the T-Mobile G1, the alternative character for the 'p' key is '='. By 
default, the Left Alt Key keybind is "Alt key", or what I would call a "Nethack 
alt key". Thus the expected behavior when pressing LeftAlt+p would be for 
Nethack to perceive an 'alt+p' input. Instead, it receives a '=' input. Now, if 
we change the Left Alt Key keybind to "Forward to System", we would expect the 
behavior when pressing LeftAlt+p to be for Nethack to perceive a '=' input. 
Instead, Nethack perceives a 'p' input.

The only workaround is to map alt to a benign key like back or camera, but that 
is a terrible waste, given that most Android hard keyboards have two hard alt 
keys in prime finger position.

What version of the product are you using? On what operating system?
Tested this on both T-Mobile G1 (1.6) and Verizon Droid (2.2), both are 
official unmodified stock Android systems.

Please provide any additional information below.

Original issue reported on code.google.com by jas...@gmail.com on 29 Aug 2010 at 10:07

GoogleCodeExporter commented 8 years ago
Thanks for bringing up the issue. Let me see if I understand you correctly... 
it sounds like what you want is basically the ability to map a physical key to 
work like the "Meta" key in NetHack, right? I think that's what the Alt key on 
many systems would map to. For example, you want to press Alt+P to pray (called 
"M-p" in the command help in NetHack)? I think I would be able to quite easily 
add that as one of the options in the key bindings. I believe all these 
commands can be accessed in other ways (like #pray, in this case), but yeah, no 
reason to not support it. By the way, the reason why "forward to system" 
doesn't give you '=' in your example is that it's still the application that 
receives the physical keys and asks the system to translate into characters, 
and with the "forward to system" option the application just ignores the key 
and tells the system it didn't handle it at all. Perhaps confusing, but makes 
sense for some of the keys (like the volume buttons).

Original comment by farnst...@gmail.com on 29 Aug 2010 at 11:00