diff --git a/stella/src/emucore/EventHandler.cxx b/stella/src/emucore/EventHandler.cxx index 15a7017ad..73c6e15fd 100644 --- a/stella/src/emucore/EventHandler.cxx +++ b/stella/src/emucore/EventHandler.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventHandler.cxx,v 1.180 2006-12-08 16:49:25 stephena Exp $ +// $Id: EventHandler.cxx,v 1.181 2006-12-08 20:19:58 stephena Exp $ //============================================================================ #include @@ -631,9 +631,9 @@ void EventHandler::poll(uInt32 time) { // Assign ascii field if it doesn't exist // Make sure 'state change' keys (Shift, Ctrl, etc) are excluded - if(key > SDLK_F15 && key < SDLK_HELP) return; if(!ascii || ascii >= SDLK_LAST || - ascii == SDLK_BACKSPACE || ascii == SDLK_DELETE) ascii = key; + key == SDLK_BACKSPACE || key == SDLK_DELETE) ascii = key; + if(key > SDLK_F15 && key < SDLK_HELP) ascii = 0; myOverlay->handleKeyEvent(ascii, key, mod, state); } @@ -1525,8 +1525,7 @@ void EventHandler::setJoyHatMap() bool EventHandler::addKeyMapping(Event::Type event, EventMode mode, int key) { // These keys cannot be remapped - if(key == SDLK_TAB || (key > SDLK_F15 && key < SDLK_HELP) || - eventIsAnalog(event)) + if(key == SDLK_TAB || eventIsAnalog(event)) return false; else { diff --git a/stella/src/gui/Dialog.cxx b/stella/src/gui/Dialog.cxx index ee2271188..184dc2235 100644 --- a/stella/src/gui/Dialog.cxx +++ b/stella/src/gui/Dialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Dialog.cxx,v 1.50 2006-12-08 16:49:33 stephena Exp $ +// $Id: Dialog.cxx,v 1.51 2006-12-08 20:19:58 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -314,7 +314,7 @@ void Dialog::handleKeyDown(int ascii, int keycode, int modifiers) // Check the keytable now, since we might get one of the above events, // which must always be processed before any widget sees it. if(e == Event::NoType) - e = instance()->eventHandler().eventForKey(ascii, kMenuMode); + e = instance()->eventHandler().eventForKey(keycode, kMenuMode); // Unless a widget has claimed all responsibility for data, we assume // that if an event exists for the given data, it should have priority. diff --git a/stella/src/gui/EditableWidget.cxx b/stella/src/gui/EditableWidget.cxx index 59fdeeae3..485eec38c 100644 --- a/stella/src/gui/EditableWidget.cxx +++ b/stella/src/gui/EditableWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EditableWidget.cxx,v 1.19 2006-12-08 16:49:33 stephena Exp $ +// $Id: EditableWidget.cxx,v 1.20 2006-12-08 20:19:58 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -92,7 +92,7 @@ bool EditableWidget::handleKeyDown(int ascii, int keycode, int modifiers) bool handled = true; bool dirty = false; - switch (ascii) + switch (keycode) { case '\n': // enter/return case '\r': diff --git a/stella/src/gui/ListWidget.cxx b/stella/src/gui/ListWidget.cxx index 23ba28bc7..2584e25f0 100644 --- a/stella/src/gui/ListWidget.cxx +++ b/stella/src/gui/ListWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: ListWidget.cxx,v 1.45 2006-12-08 16:49:35 stephena Exp $ +// $Id: ListWidget.cxx,v 1.46 2006-12-08 20:19:58 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -263,7 +263,7 @@ bool ListWidget::handleKeyDown(int ascii, int keycode, int modifiers) else { // not editmode - switch (ascii) + switch (keycode) { case ' ': // space // Snap list back to currently highlighted line diff --git a/stella/src/gui/PopUpWidget.cxx b/stella/src/gui/PopUpWidget.cxx index 72ad80206..074d3ad46 100644 --- a/stella/src/gui/PopUpWidget.cxx +++ b/stella/src/gui/PopUpWidget.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: PopUpWidget.cxx,v 1.29 2006-12-08 16:49:36 stephena Exp $ +// $Id: PopUpWidget.cxx,v 1.30 2006-12-08 20:19:58 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -135,7 +135,7 @@ void PopUpDialog::handleKeyDown(int ascii, int keycode, int modifiers) if(isMouseDown()) return; - Event::Type e = instance()->eventHandler().eventForKey(ascii, kMenuMode); + Event::Type e = instance()->eventHandler().eventForKey(keycode, kMenuMode); handleEvent(e); }