Ignore:
Timestamp:
Jan 4, 2003, 1:21:44 PM (23 years ago)
Author:
sandervl
Message:

fix for alt key & menu activation; fixed color of highlighted menubar item

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/oslibmsgtranslate.cpp

    r9598 r9607  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.97 2003-01-03 16:35:54 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.98 2003-01-04 12:21:44 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    646646#endif
    647647
    648 #ifdef ALTGR_HACK
    649    
    650 
    651         if (usPMScanCode == PMSCAN_ALTRIGHT)
    652         {
    653           // Turn message into CTRL-event
    654           // The original PM message is still saved inside
    655           // the TEB, the next call to TranslateMessage()
    656           // will then generate the required additional message
    657           // for the ALTGR-event.
    658           winMsg->wParam = VK_LCONTROL_W;
    659           winMsg->lParam = repeatCount & 0x0FFFF;
    660           winMsg->lParam |= WINSCAN_CTRLLEFT << 16
    661                             |  WIN_KEY_DONTCARE;
    662          
    663           if (flags & KC_KEYUP)
    664           {
    665             winMsg->message = WINWM_SYSKEYUP;
    666             winMsg->lParam |= WIN_KEY_ALTHELD;                      // bit 29, alt was pressed
    667             winMsg->lParam |= WIN_KEY_PREVSTATE;                    // bit 30, previous state, always 1 for a WM_KEYUP message
    668             winMsg->lParam |= 1 << 31;                              // bit 31, transition state, always 1 for WM_KEYUP
    669            
    670             // Note: altgr affects the alt-key state in windows!
    671             // The overlay causes GetKeyState/GetAsyncKeyState to return
    672             // the correct states
    673             KeySetOverlayKeyState(VK_LCONTROL_W, KEYOVERLAYSTATE_DONTCARE);
    674             KeySetOverlayKeyState(VK_CONTROL_W, KEYOVERLAYSTATE_DONTCARE);
    675           }
    676           else
    677           {
    678             winMsg->lParam |= WIN_KEY_ALTHELD;
    679             if (keyWasPressed)
    680               winMsg->lParam |= WIN_KEY_PREVSTATE;     // bit 30, previous state, 1 means key was pressed
    681             winMsg->message = WINWM_KEYDOWN;
    682            
    683             // Note: altgr affects the alt-key state in windows!
    684             // The overlay causes GetKeyState/GetAsyncKeyState to return
    685             // the correct states
    686             KeySetOverlayKeyState(VK_LCONTROL_W, KEYOVERLAYSTATE_DOWN);
    687             KeySetOverlayKeyState(VK_CONTROL_W, KEYOVERLAYSTATE_DOWN);
    688             KeySetOverlayKeyState(VK_RMENU_W, KEYOVERLAYSTATE_DOWN);
    689             KeySetOverlayKeyState(VK_MENU_W, KEYOVERLAYSTATE_DOWN);
    690            
    691             // Note: when CTRL comes up, windows keeps ALTGR still down!
    692             // KeySetOverlayKeyState(VK_RMENU_W, KEYOVERLAYSTATE_DOWN);
    693           }
    694         }     
    695 #endif
    696648
    697649        //@PF This looks ugly but this is just what we have in win32 both in win98/win2k
     
    811763          }
    812764        }
    813 
    814 #ifdef ALTGR_HACK
    815         // it's a PMSCAN_ALTRIGHT WM_CHAR message?
    816         // and not previously translated?
    817         if(fMsgRemoved && usPMScanCode == PMSCAN_ALTRIGHT && !(teb->o.odin.fTranslated))
    818         {
    819             dprintf(("Queue ALTRIGHT message"));
    820             // special ALTRIGHT treatment:
    821             // we try to insert another WM_KEYDOWN or WM_KEYUP instead of
    822             // the usual WM_CHAR which is expected here.
    823             // -> experimental
    824             // it's really an OS/2-style WM_CHAR message?
    825             MSG extramsg;
    826             memcpy(&extramsg, winMsg, sizeof(MSG));
    827    
    828             // AltGr is not released with WINWM_SYSKEYUP, but WINWM_KEYUP
    829             if(flags & KC_KEYUP)
    830             {
    831                 extramsg.message = WINWM_KEYUP;
    832             }
    833             extramsg.wParam = VK_RMENU_W;
    834    
    835             // mask out message bits and scan code
    836             extramsg.lParam &= (0xDC00FFFF);
    837             extramsg.lParam |= (WINSCAN_ALTRIGHT & 0x1FF) << 16;
    838 ////            extramsg.lParam |= WIN_KEY_EXTENDED;
    839             if (!(flags & KC_KEYUP))
    840                 extramsg.lParam |= WIN_KEY_ALTHELD;
    841  
    842             // insert message into the queue
    843             setThreadQueueExtraCharMessage(teb, &extramsg);
    844         }
    845 #endif
    846765        break;
    847766    }
Note: See TracChangeset for help on using the changeset viewer.