Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old January 9, 2012, 13:59   #1
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,761
PowerWyrm is on a distinguished road
GCU port: problem with keypresses?

Anyone using this port with Windows in console mode? I managed to compile a version of the client using PDCurses (defined both USE_GCU and WIN32_CONSOLE_MODE), it works perfectly... except for the keypresses. Pressing a key does nothing 99% of the time, and when it works, it simply takes ages to respond. Keys are queued, but most of the time don't seem to be processed. Any idea?
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old January 10, 2012, 14:22   #2
PowerWyrm
Prophet
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 2,761
PowerWyrm is on a distinguished road
Nevermind... found the problem. From the curses documentation:

"The halfdelay routine is used for half-delay mode, which is similar to cbreak mode in that characters typed by the user are immediately available to the program. However, after blocking for tenths tenths of seconds, ERR is returned if nothing has been typed. The value of tenths must be a number between 1 and 255. Use nocbreak to leave half-delay mode."

And in main-gcu (Term_xtra_gcu_event):
Code:
		/* Wait for a keypress; use halfdelay(1) so if the user takes more */
		/* than 0.2 seconds we get a chance to do updates. */
		halfdelay(2);
		i = getch();
		while (i == ERR) {
			i = getch();
			idle_update();
		}
		cbreak();
Half-delay mode is still occuring when leaving this part of code. Even if it sounds useless, a call to nocbreak() must be made before calling cbreak().
__________________
PWMAngband variant maintainer - check http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm 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
OpenGL port BreathesFire Development 2 November 3, 2011 07:22
Bold fonts in GCU mode... opinions? d_m Vanilla 3 January 13, 2010 14:42
improved GCU code in HEAD d_m Vanilla 23 August 19, 2009 19:59
[V] Gtk port Magnate Development 1 February 24, 2009 09:48
[ALL variants] Getting main-gcu to handle resizes. CJNyfalt Vanilla 5 May 27, 2007 13:47


All times are GMT +1. The time now is 00:18.


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