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/qapplication_pm.cpp

    r317 r353  
    842842        } else {
    843843            switch(msg) {
     844
     845            case WM_TRANSLATEACCEL: {
     846                if (widget->isWindow()) {
     847                    rc = WinDefWindowProc(hwnd, msg, mp1, mp2);
     848                    if (rc) {
     849                        QMSG &qmsg = *(QMSG*)mp1;
     850                        if (qmsg.msg == WM_SYSCOMMAND &&
     851                            WinWindowFromID(widget->internalFrameWinId(),
     852                                            FID_SYSMENU)) {
     853                            switch (SHORT1FROMMP(qmsg.mp1)) {
     854                                case SC_CLOSE:
     855                                case SC_TASKMANAGER:
     856                                    return (MRESULT)TRUE;
     857                                default:
     858                                    break;
     859                            }
     860                        }
     861                    }
     862                }
     863                // return FALSE in all other cases to let Qt process keystrokes
     864                // that are in the system-wide frame accelerator table.
     865                return FALSE;
     866            }
    844867
    845868            case WM_CHAR: { // keyboard event
Note: See TracChangeset for help on using the changeset viewer.