aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorMax Horn2002-11-22 18:46:18 +0000
committerMax Horn2002-11-22 18:46:18 +0000
commit0b82e20b00dc7056494ce2bd6a5554d6813d4974 (patch)
tree045fce394992d51ccf81004aa1b046d62efa644b /gui
parent17cf386e8820fe312eb216c9be93d6d309f512e1 (diff)
downloadscummvm-rg350-0b82e20b00dc7056494ce2bd6a5554d6813d4974.tar.gz
scummvm-rg350-0b82e20b00dc7056494ce2bd6a5554d6813d4974.tar.bz2
scummvm-rg350-0b82e20b00dc7056494ce2bd6a5554d6813d4974.zip
improved keyboard input behaviour in SDL backend: make use of the unicode feature in SDL. This way, Shift-1 on my german keyboard generates ! not 1 (on an US keyboard it'll be a different symbol). Should fix bug #600258 and #551447
svn-id: r5692
Diffstat (limited to 'gui')
-rw-r--r--gui/EditTextWidget.cpp8
-rw-r--r--gui/ListWidget.cpp14
2 files changed, 12 insertions, 10 deletions
diff --git a/gui/EditTextWidget.cpp b/gui/EditTextWidget.cpp
index e91aff4986..10caf64cd7 100644
--- a/gui/EditTextWidget.cpp
+++ b/gui/EditTextWidget.cpp
@@ -76,13 +76,13 @@ bool EditTextWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers)
_label.deleteLastChar();
dirty = true;
break;
- case 20: // left arrow
+ case 256+20: // left arrow
break;
- case 19: // right arrow
+ case 256+19: // right arrow
break;
- case 22: // home
+ case 256+22: // home
break;
- case 23: // end
+ case 256+23: // end
break;
default:
if (isprint((char)ascii)) {
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 3a1937d0fe..19024f952d 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -142,6 +142,8 @@ bool ListWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers)
bool dirty = false;
int oldSelectedItem = _selectedItem;
+printf("ListWidget::handleKeyDown(%d, %d, %d)\n", (int)ascii, (int)keycode, (int)modifiers);
+
if (_editMode) {
if (_caretVisible)
@@ -189,28 +191,28 @@ bool ListWidget::handleKeyDown(uint16 ascii, int keycode, int modifiers)
}
}
break;
- case 17: // up arrow
+ case 256+17: // up arrow
if (_selectedItem > 0)
_selectedItem--;
break;
- case 18: // down arrow
+ case 256+18: // down arrow
if (_selectedItem < _list.size() - 1)
_selectedItem++;
break;
- case 24: // pageup
+ case 256+24: // pageup
_selectedItem -= _entriesPerPage - 1;
if (_selectedItem < 0)
_selectedItem = 0;
break;
- case 25: // pagedown
+ case 256+25: // pagedown
_selectedItem += _entriesPerPage - 1;
if (_selectedItem >= _list.size() )
_selectedItem = _list.size() - 1;
break;
- case 22: // home
+ case 256+22: // home
_selectedItem = 0;
break;
- case 23: // end
+ case 256+23: // end
_selectedItem = _list.size() - 1;
break;
default: