Changeset 126


Ignore:
Timestamp:
Sep 13, 2006, 11:12:08 PM (19 years ago)
Author:
dmik
Message:

Kernel: Fixed keyboard pocessing: Let the standard OS/2 Alt+ddd shortcut (that composed chars from typed in ASCII codes) work correctly by resetting both virtual key code and text (to "hide" them from Qt).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel/qapplication_pm.cpp

    r115 r126  
    27742774        if ( ch != 0xE0 ) {
    27752775            state |= Qt::Keypad;
    2776             if ( ch ) {
    2777                 // override code to make it Qt::Key_0..Qt::Key_9 etc.
    2778                 code = toupper( ch );
     2776            if ( (state & Qt::AltButton) && chm.vkey != VK_DELETE ) {
     2777                // reset both code and ch to "hide" them from Qt widgets and let
     2778                // the standard OS/2 Alt+ddd shortcut (that composed chars from
     2779                // typed in ASCII codes) work correctly. If we don't do that,
     2780                // widgets will see both individual digits (or cursor movements
     2781                // if NumLock is off) and the char composed by Alt+ddd.
     2782                code = ch = 0;
     2783            } else {
     2784                if ( ch ) {
     2785                    // override code to make it Qt::Key_0..Qt::Key_9 etc.
     2786                    code = toupper( ch );
     2787                }
    27792788            }
    27802789        } else {
     
    27862795    switch ( chm.scancode ) {
    27872796        case 0x4C: // 5
    2788             // scancode is zero if Numlock is set
    2789             if ( !code ) code = Qt::Key_Clear;
    27902797            state |= Qt::Keypad;
     2798            if ( state & Qt::AltButton ) {
     2799                // reset both code and ch to "hide" them from Qt (see above)
     2800                code = ch = 0;
     2801            } else {
     2802                // scancode is zero if Numlock is set
     2803                if ( !code ) code = Qt::Key_Clear;
     2804            }
    27912805            break;
    27922806        case 0x37: // *
Note: See TracChangeset for help on using the changeset viewer.