summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/windowmanager-sdl.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2011-04-02 15:10:08 +0200
committerAdam Borowski <kilobyte@angband.pl>2011-04-02 15:52:57 +0200
commit3c9e0a35eb2f85f410fa48aa3adf0fc0090b7ea9 (patch)
treeb3bbb6ec7cb30a21981a86d70a0ac8f88f7f4653 /crawl-ref/source/windowmanager-sdl.cc
parentd39bda75610f819afe01494d1e448c0621da8a22 (diff)
downloadcrawl-ref-3c9e0a35eb2f85f410fa48aa3adf0fc0090b7ea9.tar.gz
crawl-ref-3c9e0a35eb2f85f410fa48aa3adf0fc0090b7ea9.zip
Don't assert on function keys that produce a symbol.
Arrow keys for example produce digits if by a mistake NumLock is on. This is an user error as NumLock keys should be ripped away from all keyboards, but there might be actual valid cases like this :p I'm not sure if the opposite case can happen, but since there's no obvious thing to do I'm leaving the assertion there for now.
Diffstat (limited to 'crawl-ref/source/windowmanager-sdl.cc')
-rw-r--r--crawl-ref/source/windowmanager-sdl.cc15
1 files changed, 1 insertions, 14 deletions
diff --git a/crawl-ref/source/windowmanager-sdl.cc b/crawl-ref/source/windowmanager-sdl.cc
index a432f049e8..e87a7c49b5 100644
--- a/crawl-ref/source/windowmanager-sdl.cc
+++ b/crawl-ref/source/windowmanager-sdl.cc
@@ -485,21 +485,8 @@ int SDLWrapper::wait_event(wm_event *event)
event->key.keysym.unicode = sdlevent.key.keysym.unicode;
event->key.keysym.sym = _translate_keysym(sdlevent.key.keysym);
- // Everything that's not an actual character (ie, all special keys)
- // must be < 0. Dead/shift keys are 0.
#ifdef ASSERTS
- if (event->key.keysym.unicode)
- {
- if (event->key.keysym.sym <= 0)
- {
- die("Valid character '%lc' %d[%x] yet keysym %d <= 0",
- event->key.keysym.unicode,
- event->key.keysym.unicode,
- event->key.keysym.unicode,
- event->key.keysym.sym);
- }
- }
- else if (event->key.keysym.sym > 0)
+ if (!event->key.keysym.unicode && event->key.keysym.sym > 0)
die("Keysym %d > 0 yet no valid character", event->key.keysym.sym);
#endif
break;