Ignore:
Timestamp:
Sep 27, 1999, 12:24:51 AM (26 years ago)
Author:
sandervl
Message:

Keyboard msg fixes

File:
1 edited

Legend:

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

    r1060 r1067  
    1 /* $Id: win32wbase.cpp,v 1.15 1999-09-26 11:09:39 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.16 1999-09-26 22:24:29 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    897897}
    898898//******************************************************************************
     899//TODO: Is this correct and complete?
     900//******************************************************************************
     901void Win32BaseWindow::setExtendedKey(ULONG virtualkey, ULONG *lParam)
     902{
     903    switch(virtualkey) {
     904    case VK_DOWN:
     905    case VK_UP:
     906    case VK_PRIOR:
     907    case VK_NEXT:
     908    case VK_END:
     909    case VK_DIVIDE:
     910    case VK_DELETE:
     911    case VK_EXECUTE: //Numeric enter key?
     912    case VK_HOME:
     913    case VK_INSERT:
     914    case VK_RCONTROL:
     915    case VK_RMENU: //is this the right alt???
     916        *lParam = *lParam | (1<<24);
     917    }
     918}
     919//******************************************************************************
    899920//TODO: virtual key & (possibly) scancode translation, extended keyboard bit & Unicode
    900921//******************************************************************************
     
    905926    lParam  = repeatcnt;
    906927    lParam |= (scancode << 16);
     928    setExtendedKey(vkey, &lParam);
     929
    907930    if(keyflags & KEY_ALTDOWN)
    908931        lParam |= (1<<29);
     
    936959    dprintf(("WM_KEYUP: vkey:(%x) param:(%x)", virtualKey, lParam));
    937960
     961    setExtendedKey(virtualKey, &lParam);
    938962    return SendInternalMessageA (WM_KEYUP, virtualKey, lParam);
    939963}
     
    953977                                                    // bit 31, transition state, always 0 for WM_KEYDOWN
    954978
     979    setExtendedKey(virtualKey, &lParam);
     980
    955981    dprintf(("WM_KEYDOWN: vkey:(%x) param:(%x)", virtualKey, lParam));
    956982
     
    971997    lParam |= 1 << 31;                              // bit 31, transition state, always 1 for WM_KEYUP
    972998
     999    setExtendedKey(virtualKey, &lParam);
    9731000    dprintf(("WM_SYSKEYUP: vkey:(%x) param:(%x)", virtualKey, lParam));
    9741001
     
    9901017                                                    // bit 31, transition state, always 0 for WM_KEYDOWN
    9911018
     1019    setExtendedKey(virtualKey, &lParam);
    9921020    dprintf(("WM_SYSKEYDOWN: vkey:(%x) param:(%x)", virtualKey, lParam));
    9931021
     
    13191347        return HTCLIENT;
    13201348
     1349    case WM_SYSKEYDOWN:
     1350            if(HIWORD(lParam) & KEYDATA_ALT)
     1351            {
     1352            if(wParam == VK_F4) /* try to close the window */
     1353            {
     1354                    HWND hWnd = WIN_GetTopParent( wndPtr->hwndSelf );
     1355                    wndPtr = WIN_FindWndPtr( hWnd );
     1356                    if( wndPtr && !(getClass()->getStyle() & CS_NOCLOSE) )
     1357                            PostMessage(WM_SYSCOMMAND, SC_CLOSE, 0);
     1358            }
     1359        }
     1360        return 0;
     1361
    13211362    default:
    13221363        return 1;
Note: See TracChangeset for help on using the changeset viewer.