Changeset 492 for trunk/src


Ignore:
Timestamp:
Jan 29, 2010, 2:35:47 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Fixed: Numpad keys with numbers reported wrong key codes when Numpad is ON (#121).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qkeymapper_pm.cpp

    r434 r492  
    641641    }
    642642
     643    if ((state & Qt::KeypadModifier) && (chm.fs & KC_CHAR) &&
     644        chm.vkey != VK_ENTER) {
     645        // if it's a numpad key and it also provides a character, it means
     646        // Numlock is on. According to other platforms, key code must be the
     647        // character value in this case. Reset code to 0 to have it done so.
     648        // Enter is an exception as it should always produce a virtual code.
     649        if (chm.fs & KC_CHAR)
     650            code = 0;
     651    }
     652
    643653    // Note: code and/or chm.scancode may be zero here. We cannot ignore such
    644654    // events because, for example, all non-ASCII letters have zero virtual
Note: See TracChangeset for help on using the changeset viewer.