Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Variants

Reply
 
Thread Tools Display Modes
Old January 21, 2022, 23:03   #1
smbhax
Apprentice
 
Join Date: Oct 2021
Location: WA
Posts: 88
smbhax is on a distinguished road
Code fix for the "slow ESC" key input in old variants?

Old variants such as Hellband and Zangband process ESC key input only after a momentary delay, at least in Curses mode; the "tilde" key just below ESC does the same thing, but operates immediately.

Is there a general code fix for the slow ESC key input in these variants?
__________________
My roguelike gameplay videos

Last edited by smbhax; January 22, 2022 at 03:11.
smbhax is offline   Reply With Quote
Old January 22, 2022, 13:49   #2
Gwarl
Knight
 
Join Date: Jan 2017
Posts: 879
Gwarl will become famous soon enough
seems like it was fixed some time between vanilla 3.2.0 and vanilla 3.4.1. I daren't check 3.3.0 right now
Gwarl is offline   Reply With Quote
Old January 22, 2022, 14:35   #3
wobbly
Prophet
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 2,550
wobbly will become famous soon enough
If its the same problem oangband has I get round it by macro-ing the escape key to the escape key. Don't know why that works, just seems to.
wobbly is offline   Reply With Quote
Old January 22, 2022, 19:47   #4
smbhax
Apprentice
 
Join Date: Oct 2021
Location: WA
Posts: 88
smbhax is on a distinguished road
Quote:
Originally Posted by Gwarl View Post
seems like it was fixed some time between vanilla 3.2.0 and vanilla 3.4.1. I daren't check 3.3.0 right now
Intriguing!

Quote:
Originally Posted by wobbly View Post
If its the same problem oangband has I get round it by macro-ing the escape key to the escape key. Don't know why that works, just seems to.
Oh that's interesting. I tried doing some kind of ESC/tilde keymap in Zangband but couldn't seem to get it to take, same with an ESC-ESC one. I don't know my way around macros very well, though.
__________________
My roguelike gameplay videos
smbhax is offline   Reply With Quote
Old January 23, 2022, 04:29   #5
smbhax
Apprentice
 
Join Date: Oct 2021
Location: WA
Posts: 88
smbhax is on a distinguished road
Current Angband has a section in src/main-gcu.c starting with this disclaimer

Code:
	/* This might be a bad idea, but...
	 *
	 * Here we try to second-guess ncurses. In some cases, keypad() mode will
	 * fail to translate multi-byte escape sequences into things like number-
	 * pad actions, function keys, etc. So we can hardcode a small list of some
	 * of the most common sequences here, just in case.
and including

Code:
		case 27:        i = ESCAPE; break;
and similar statements for arrow keys, keypad keys, etc. Zangband's src/main-gcu.c has no analogous section as far as I can tell. Perhaps this section has something to do with it?

Angband's also has
Code:
	/* We do it like this to prevent a link error with curseses that
	 * lack ESCDELAY. */
	if (!getenv("ESCDELAY")) {
#if _POSIX_C_SOURCE < 200112L
		static char escdelbuf[80] = "ESCDELAY=20";
		putenv(escdelbuf);
#else
		setenv("ESCDELAY", "20", 1);
#endif
	}
which looked tantalizing, but just dropping it in Zangband did not magically cure the sluggish ESC key. ;; )
__________________
My roguelike gameplay videos

Last edited by smbhax; January 23, 2022 at 05:20.
smbhax is offline   Reply With Quote
Old January 23, 2022, 10:58   #6
smbhax
Apprentice
 
Join Date: Oct 2021
Location: WA
Posts: 88
smbhax is on a distinguished road
Quote:
Originally Posted by Gwarl View Post
seems like it was fixed some time between vanilla 3.2.0 and vanilla 3.4.1. I daren't check 3.3.0 right now
I went to try out the releases in this range but for all of them got "multiple definitions" compile errors concerning z-file.h or z-term.h, so I have been of no use.
__________________
My roguelike gameplay videos
smbhax is offline   Reply With Quote
Old January 23, 2022, 11:03   #7
smbhax
Apprentice
 
Join Date: Oct 2021
Location: WA
Posts: 88
smbhax is on a distinguished road
In build notes, the only thing that jumped out at me--not that I know that I'm looking for--is that 3.4.0 included "Upgrade to UTF-8."

Oh and "Fix GCU port to recognise backspace and del as distinct keys."
__________________
My roguelike gameplay videos
smbhax is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
roguelike keyset targeting mode: "k" key (up) only works in uppercase "K" yendor Vanilla 2 October 6, 2021 03:31
Bug: "n" not counted as a non-"ESC" key chikinn Vanilla 3 November 8, 2014 23:34
Bug with "Turn" in the "Player History" dump bron Vanilla 3 January 17, 2014 17:35
(Hopefully) useful code snippet modifies "]" command to highlight unidentified items Max Stats Vanilla 31 January 11, 2011 22:12
"repeat" Command just little bit "smarter" ClaytonAguiar Vanilla 8 June 17, 2009 16:01


All times are GMT +1. The time now is 13:54.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.