Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
altmeta Alt key hack, mainly for unix (trunk only)
Some time ago we received a patch submission which attempted to handle the Alt key for terminals or emulators which transmit two char sequence "ESC c" when Alt+c is pressed, but I can't find it. I don't remember the details but recall that it had at least once significant problem (perhaps just that it was unconditional, although it may have been implemented in a way which interferred with using ESC to cancel). This patch reimplements the desired fix, making the new behavior be conditional on a boolean option: altmeta. That option already exists for the Amiga port, where it deals with low-level keyboard handling but essentially affects the same thing: whether Alt+key can be used as a shortcut for various extended commands. This one affects how the core processes commands, and is only available if ALTMETA is defined at compile time. I've defined that for Unix and VMS; other ports don't seem to need it. (I'm not sure whether "options" created by makedefs ought to mention it. So far, it doesn't since this isn't something users are expected to tweak. The setting of the non-Amiga altmeta option doesn't get saved and restored, so won't affect saved data if someone does toggle ALTMETA and then rebuild.) When [non-Amiga] altmeta is set, nethack's core will give special handling to ESC, but only during top level command processing. If ESC is seen while reading a command, it will be consumed and then the next character seen will have its meta bit set. This introduces a potential problem: typing ESC as a command will result in waiting for another character instead of reporting that that isn't a valid command. Since it isn't a valid command, this shouldn't be a big deal, but starting a count intended to prefix your next command and then typing ESC after deciding to abort that count runs into the same situation: nethack will wait for another character to complete the two character sequence expected for "ESC c". There's not much that can be done with this, other than have the Guidebook mention that an extra ESC is needed to cancel the pending count, because digits followed by ESC could actually be a numeric prefix for Alt+something rather than an attempt to abort the count.
- Loading branch information
nethack.rankin
committed
Apr 19, 2011
1 parent
8df1e4d
commit 2f1813c
Showing
10 changed files
with
115 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters