fixed bug that caused the wrong keycode to be used for most,

possibly all, keysyms.  was reading past the end of an array
of keysyms.
This commit is contained in:
crs 2002-09-04 20:17:54 +00:00
parent e4c29179d9
commit 7f21588e9b
1 changed files with 7 additions and 1 deletions

View File

@ -917,7 +917,7 @@ void
CXWindowsSecondaryScreen::updateKeycodeMap(Display* display) CXWindowsSecondaryScreen::updateKeycodeMap(Display* display)
{ {
// there are up to 4 keysyms per keycode // there are up to 4 keysyms per keycode
static const int numKeysyms = 4; static const int maxKeysyms = 4;
// get the number of keycodes // get the number of keycodes
int minKeycode, maxKeycode; int minKeycode, maxKeycode;
@ -930,6 +930,12 @@ CXWindowsSecondaryScreen::updateKeycodeMap(Display* display)
minKeycode, numKeycodes, minKeycode, numKeycodes,
&keysymsPerKeycode); &keysymsPerKeycode);
// we only understand up to maxKeysyms keysyms per keycodes
int numKeysyms = keysymsPerKeycode;
if (numKeysyms > maxKeysyms) {
numKeysyms = maxKeysyms;
}
// initialize // initialize
KeyCodeMask entry; KeyCodeMask entry;
m_keycodeMap.clear(); m_keycodeMap.clear();