Ignore:
Timestamp:
Nov 27, 2009, 1:20:02 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui/kernel: Completely steal the Alt key and other default shortcuts (Alt+F7, Alt+F10 etc) from the system-wide frame accelerator table so that they can be normally processed by Qt applications. The only ones remaining for the system are are Alt+F4, Ctrl+Esc, Alt+Esc.

File:
1 edited

Legend:

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

    r180 r353  
    375375        KeyRecord *rec = key_recorder.findKey(chm.scancode, false);
    376376
     377        if (state == Qt::AltModifier) {
     378            // Special handling of global PM hotkeys
     379            switch (code) {
     380                case Qt::Key_Space: {
     381                    // show system menu
     382                    HWND fId = widget->window()->internalFrameWinId();
     383                    HWND sysMenu = WinWindowFromID(fId, FID_SYSMENU);
     384                    if (!sysMenu)
     385                        break; // no menu for this window
     386                    WinPostMsg(sysMenu, MM_STARTMENUMODE,
     387                               MPFROM2SHORT(TRUE, FALSE), 0);
     388                    return true;
     389                }
     390                case Qt::Key_F4: {
     391                    // we handle this key combination ourselves because not
     392                    // all top-level widgets have the system menu
     393                    WinPostMsg(widget->window()->internalFrameWinId(),
     394                               WM_CLOSE, 0, 0);
     395                    return true;
     396                }
     397                default:
     398                    break;
     399            }
     400        }
     401
    377402        // If rec's state doesn't match the current state, something has changed behind our back
    378403        // (Consumed by modal widget is one possibility) So, remove the record from the list
Note: See TracChangeset for help on using the changeset viewer.