Ignore:
Timestamp:
Nov 11, 1999, 2:17:33 PM (26 years ago)
Author:
sandervl
Message:

dlg fix, keyboard additions, + misc other things

File:
1 edited

Legend:

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

    r1629 r1704  
    1 /* $Id: winkeyboard.cpp,v 1.1 1999-11-08 13:44:40 sandervl Exp $ */
     1/* $Id: winkeyboard.cpp,v 1.2 1999-11-11 13:17:33 sandervl Exp $ */
    22/*
    33 * Win32 <-> PM key translation
     
    99#include <os2win.h>
    1010#include <odin.h>
     11#include <string.h>
     12#include <stdio.h>
    1113#include <winkeyboard.h>
     14#include "oslibwin.h"
     15#include <heapstring.h>
    1216
    1317BYTE abPMScanToWinVKey[256] =
     
    289293//******************************************************************************
    290294//******************************************************************************
     295BOOL WIN32API GetKeyboardState(PBYTE lpKeyState)
     296{
     297 BYTE   PMKeyState[256];
     298 BOOL   rc;
     299
     300  dprintf(("USER32:  GetKeyboardState"));
     301  rc = OSLibWinGetKeyboardStateTable((PBYTE)&PMKeyState );
     302
     303  if(rc == TRUE)
     304  {
     305        KeyTranslatePMToWinBuf((BYTE *)&PMKeyState, lpKeyState, 256);
     306        return TRUE;
     307  }
     308  return FALSE;
     309}
     310//******************************************************************************
     311//******************************************************************************
     312BOOL WIN32API SetKeyboardState(PBYTE lpKeyState)
     313{
     314  dprintf(("USER32:  SetKeyboardState, not implemented"));
     315  return(TRUE);
     316}
     317/***********************************************************************
     318 *           GetKeyboardLayout                  (USER32.250)
     319 *
     320 * FIXME: - device handle for keyboard layout defaulted to
     321 *          the language id. This is the way Windows default works.
     322 *        - the thread identifier (dwLayout) is also ignored.
     323 */
     324// * Remark    : Based on Wine version (991031)
     325HKL WIN32API GetKeyboardLayout(DWORD dwLayout)
     326{
     327        HKL layout;
     328        layout = GetSystemDefaultLCID(); /* FIXME */
     329        layout |= (layout<<16);          /* FIXME */
     330        dprintf(("GetKeyboardLayout returning %08x\n",layout));
     331        return layout;
     332}
     333/*****************************************************************************
     334 * Name      : BOOL WIN32API GetKeyboardLayoutNameA
     335 * Purpose   : The GetKeyboardLayoutName function retrieves the name of the
     336 *             active keyboard layout.
     337 * Parameters: LPTSTR pwszKLID address of buffer for layout name
     338 * Variables :
     339 * Result    : If the function succeeds, the return value is TRUE.
     340 *             If the function fails, the return value is FALSE. To get extended
     341 *               error information, call GetLastError.
     342 * Remark    : Based on Wine version (991031)
     343 * Status    : UNTESTED STUB
     344 *
     345 * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
     346 *****************************************************************************/
     347INT WIN32API GetKeyboardLayoutNameA(LPTSTR pwszKLID)
     348{
     349   dprintf(("USER32:GetKeyboardLayoutNameA"));
     350
     351   sprintf(pwszKLID, "%08x",GetKeyboardLayout(0));
     352   return 1;
     353}
     354/*****************************************************************************
     355 * Name      : BOOL WIN32API GetKeyboardLayoutNameW
     356 * Purpose   : The GetKeyboardLayoutName function retrieves the name of the
     357 *             active keyboard layout.
     358 * Parameters: LPTSTR pwszKLID address of buffer for layout name
     359 * Variables :
     360 * Result    : If the function succeeds, the return value is TRUE.
     361 *             If the function fails, the return value is FALSE. To get extended
     362 *               error information, call GetLastError.
     363 * Remark    : Based on Wine version (991031)
     364 * Status    : UNTESTED STUB
     365 *
     366 * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
     367 *****************************************************************************/
     368INT WIN32API GetKeyboardLayoutNameW(LPWSTR pwszKLID)
     369{
     370   LPSTR buf = (LPSTR)HEAP_xalloc( GetProcessHeap(), 0, strlen("00000409")+1);
     371
     372   dprintf(("USER32:GetKeyboardLayoutNameA"));
     373   int res = GetKeyboardLayoutNameA(buf);
     374   lstrcpyAtoW(pwszKLID,buf);
     375   HeapFree( GetProcessHeap(), 0, buf );
     376   return res;
     377}
     378/***********************************************************************
     379 *           GetKeyboardLayoutList              (USER32.251)
     380 *
     381 * FIXME: Supports only the system default language and layout and
     382 *          returns only 1 value.
     383 *
     384 * Return number of values available if either input parm is
     385 *  0, per MS documentation.
     386 *
     387 * Remark    : Based on Wine version (991031)
     388 */
     389INT WINAPI GetKeyboardLayoutList(INT nBuff,HKL *layouts)
     390{
     391        dprintf(("GetKeyboardLayoutList(%d,%p)\n",nBuff,layouts));
     392        if (!nBuff || !layouts)
     393            return 1;
     394        if (layouts)
     395                layouts[0] = GetKeyboardLayout(0);
     396        return 1;
     397}
     398
     399//******************************************************************************
     400//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.