Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
8a31634a
Commit
8a31634a
authored
Oct 25, 2000
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 25, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced ToAscii by ToUnicode in the User driver interface.
parent
1e19fe32
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
54 additions
and
51 deletions
+54
-51
ttydrv.spec
dlls/ttydrv/ttydrv.spec
+1
-1
user.c
dlls/ttydrv/user.c
+3
-3
user_main.c
dlls/user/user_main.c
+1
-1
x11drv.spec
dlls/x11drv/x11drv.spec
+1
-1
user.h
include/user.h
+1
-1
x11drv.h
include/x11drv.h
+0
-1
input.c
windows/input.c
+29
-19
keyboard.c
windows/keyboard.c
+1
-1
keyboard.c
windows/x11drv/keyboard.c
+17
-23
No files found.
dlls/ttydrv/ttydrv.spec
View file @
8a31634a
...
...
@@ -15,7 +15,7 @@ import kernel32.dll
@ cdecl VkKeyScan(long) TTYDRV_VkKeyScan
@ cdecl MapVirtualKey(long long) TTYDRV_MapVirtualKey
@ cdecl GetKeyNameText(long str long) TTYDRV_GetKeyNameText
@ cdecl To
Ascii(long long ptr ptr long) TTYDRV_ToAscii
@ cdecl To
Unicode(long long ptr ptr long long) TTYDRV_ToUnicode
@ cdecl GetBeepActive() TTYDRV_GetBeepActive
@ cdecl SetBeepActive(long) TTYDRV_SetBeepActive
@ cdecl Beep() TTYDRV_Beep
...
...
dlls/ttydrv/user.c
View file @
8a31634a
...
...
@@ -70,10 +70,10 @@ INT16 TTYDRV_GetKeyNameText( LONG lParam, LPSTR lpBuffer, INT16 nSize )
}
/***********************************************************************
* TTYDRV_To
Ascii
* TTYDRV_To
Unicode
*/
INT
16
TTYDRV_ToAscii
(
UINT16
virtKey
,
UINT16
scanCod
e
,
LPBYTE
lpKeyState
,
LPVOID
lpChar
,
UINT16
flags
)
INT
TTYDRV_ToUnicode
(
UINT
virtKey
,
UINT
scanCode
,
LPBYTE
lpKeyStat
e
,
LPWSTR
pwszBuff
,
int
cchBuff
,
UINT
flags
)
{
return
0
;
}
...
...
dlls/user/user_main.c
View file @
8a31634a
...
...
@@ -64,7 +64,7 @@ static BOOL load_driver(void)
GET_USER_FUNC
(
VkKeyScan
);
GET_USER_FUNC
(
MapVirtualKey
);
GET_USER_FUNC
(
GetKeyNameText
);
GET_USER_FUNC
(
To
Ascii
);
GET_USER_FUNC
(
To
Unicode
);
GET_USER_FUNC
(
GetBeepActive
);
GET_USER_FUNC
(
SetBeepActive
);
GET_USER_FUNC
(
Beep
);
...
...
dlls/x11drv/x11drv.spec
View file @
8a31634a
...
...
@@ -15,7 +15,7 @@ import kernel32.dll
@ cdecl VkKeyScan(long) X11DRV_VkKeyScan
@ cdecl MapVirtualKey(long long) X11DRV_MapVirtualKey
@ cdecl GetKeyNameText(long str long) X11DRV_GetKeyNameText
@ cdecl To
Ascii(long long ptr ptr long) X11DRV_ToAscii
@ cdecl To
Unicode(long long ptr ptr long long) X11DRV_ToUnicode
@ cdecl GetBeepActive() X11DRV_GetBeepActive
@ cdecl SetBeepActive(long) X11DRV_SetBeepActive
@ cdecl Beep() X11DRV_Beep
...
...
include/user.h
View file @
8a31634a
...
...
@@ -51,7 +51,7 @@ typedef struct tagUSER_DRIVER {
WORD
(
*
pVkKeyScan
)(
CHAR
);
UINT16
(
*
pMapVirtualKey
)(
UINT16
,
UINT16
);
INT16
(
*
pGetKeyNameText
)(
LONG
,
LPSTR
,
INT16
);
INT
16
(
*
pToAscii
)(
UINT16
,
UINT16
,
LPBYTE
,
LPVOID
,
UINT16
);
INT
(
*
pToUnicode
)(
UINT
,
UINT
,
LPBYTE
,
LPWSTR
,
int
,
UINT
);
BOOL
(
*
pGetBeepActive
)(
void
);
void
(
*
pSetBeepActive
)(
BOOL
);
void
(
*
pBeep
)(
void
);
...
...
include/x11drv.h
View file @
8a31634a
...
...
@@ -368,7 +368,6 @@ extern void X11DRV_InitKeyboard(void);
extern
WORD
X11DRV_VkKeyScan
(
CHAR
cChar
);
extern
UINT16
X11DRV_MapVirtualKey
(
UINT16
wCode
,
UINT16
wMapType
);
extern
INT16
X11DRV_GetKeyNameText
(
LONG
lParam
,
LPSTR
lpBuffer
,
INT16
nSize
);
extern
INT16
X11DRV_ToAscii
(
UINT16
virtKey
,
UINT16
scanCode
,
LPBYTE
lpKeyState
,
LPVOID
lpChar
,
UINT16
flags
);
extern
BOOL
X11DRV_GetDIState
(
DWORD
len
,
LPVOID
ptr
);
extern
BOOL
X11DRV_GetDIData
(
BYTE
*
keystate
,
DWORD
dodsize
,
struct
DIDEVICEOBJECTDATA
*
dod
,
LPDWORD
entries
,
DWORD
flags
);
extern
void
X11DRV_GetKeyboardConfig
(
struct
tagKEYBOARD_CONFIG
*
cfg
);
...
...
windows/input.c
View file @
8a31634a
...
...
@@ -971,12 +971,38 @@ INT WINAPI GetKeyNameTextW(LONG lParam, LPWSTR lpBuffer, INT nSize)
}
/****************************************************************************
* ToUnicode (USER32.@)
*/
INT
WINAPI
ToUnicode
(
UINT
virtKey
,
UINT
scanCode
,
LPBYTE
lpKeyState
,
LPWSTR
lpwStr
,
int
size
,
UINT
flags
)
{
return
USER_Driver
.
pToUnicode
(
virtKey
,
scanCode
,
lpKeyState
,
lpwStr
,
size
,
flags
);
}
/****************************************************************************
* ToUnicodeEx (USER32.@)
*/
INT
WINAPI
ToUnicodeEx
(
UINT
virtKey
,
UINT
scanCode
,
LPBYTE
lpKeyState
,
LPWSTR
lpwStr
,
int
size
,
UINT
flags
,
HKL
hkl
)
{
/* FIXME: need true implementation */
return
ToUnicode
(
virtKey
,
scanCode
,
lpKeyState
,
lpwStr
,
size
,
flags
);
}
/****************************************************************************
* ToAscii (USER32.546)
*/
INT
WINAPI
ToAscii
(
UINT
virtKey
,
UINT
scanCode
,
LPBYTE
lpKeyState
,
LPWORD
lpChar
,
UINT
flags
)
{
return
ToAscii16
(
virtKey
,
scanCode
,
lpKeyState
,
lpChar
,
flags
);
WCHAR
uni_chars
[
2
];
INT
ret
,
n_ret
;
ret
=
ToUnicode
(
virtKey
,
scanCode
,
lpKeyState
,
uni_chars
,
2
,
flags
);
if
(
ret
<
0
)
n_ret
=
1
;
/* FIXME: make ToUnicode return 2 for dead chars */
else
n_ret
=
ret
;
WideCharToMultiByte
(
CP_ACP
,
0
,
uni_chars
,
n_ret
,
(
LPSTR
)
lpChar
,
2
,
NULL
,
NULL
);
return
ret
;
}
/****************************************************************************
...
...
@@ -985,8 +1011,8 @@ INT WINAPI ToAscii( UINT virtKey,UINT scanCode,LPBYTE lpKeyState,
INT
WINAPI
ToAsciiEx
(
UINT
virtKey
,
UINT
scanCode
,
LPBYTE
lpKeyState
,
LPWORD
lpChar
,
UINT
flags
,
HKL
dwhkl
)
{
/* FIXME: need true implementation */
return
ToAscii
16
(
virtKey
,
scanCode
,
lpKeyState
,
lpChar
,
flags
);
/* FIXME: need true implementation */
return
ToAscii
(
virtKey
,
scanCode
,
lpKeyState
,
lpChar
,
flags
);
}
/**********************************************************************
...
...
@@ -1039,22 +1065,6 @@ BOOL WINAPI UnregisterHotKey(HWND hwnd,INT id) {
return
TRUE
;
}
/***********************************************************************
* ToUnicode (USER32.548)
*/
INT
WINAPI
ToUnicode
(
UINT
wVirtKey
,
UINT
wScanCode
,
PBYTE
lpKeyState
,
LPWSTR
pwszBuff
,
INT
cchBuff
,
UINT
wFlags
)
{
FIXME_
(
keyboard
)(
": stub
\n
"
);
return
0
;
}
/***********************************************************************
* LoadKeyboardLayoutA (USER32.367)
* Call ignored. WINE supports only system default keyboard layout.
...
...
windows/keyboard.c
View file @
8a31634a
...
...
@@ -252,7 +252,7 @@ INT16 WINAPI GetKeyNameText16(LONG lParam, LPSTR lpBuffer, INT16 nSize)
INT16
WINAPI
ToAscii16
(
UINT16
virtKey
,
UINT16
scanCode
,
LPBYTE
lpKeyState
,
LPVOID
lpChar
,
UINT16
flags
)
{
return
USER_Driver
.
p
ToAscii
(
virtKey
,
scanCode
,
lpKeyState
,
lpChar
,
flags
);
return
ToAscii
(
virtKey
,
scanCode
,
lpKeyState
,
lpChar
,
flags
);
}
/***********************************************************************
...
...
windows/x11drv/keyboard.c
View file @
8a31634a
...
...
@@ -1369,9 +1369,9 @@ static char KEYBOARD_MapDeadKeysym(KeySym keysym)
}
/***********************************************************************
* X11DRV_To
Ascii
* X11DRV_To
Unicode
*
* The To
Ascii
function translates the specified virtual-key code and keyboard
* The To
Unicode
function translates the specified virtual-key code and keyboard
* state to the corresponding Windows character or characters.
*
* If the specified key is a dead key, the return value is negative. Otherwise,
...
...
@@ -1386,14 +1386,14 @@ static char KEYBOARD_MapDeadKeysym(KeySym keysym)
* FIXME : should do the above (return 2 for non matching deadchar+char combinations)
*
*/
INT16
X11DRV_ToAscii
(
UINT16
virtKey
,
UINT16
scanCode
,
LPBYTE
lpKeyState
,
LPVOID
lpChar
,
UINT16
flags
)
INT
X11DRV_ToUnicode
(
UINT
virtKey
,
UINT
scanCode
,
LPBYTE
lpKeyState
,
LPWSTR
bufW
,
int
bufW_size
,
UINT
flags
)
{
XKeyEvent
e
;
KeySym
keysym
;
INT
ret
;
int
keyc
;
BYTE
lpChar
[
2
];
if
(
scanCode
==
0
)
{
/* This happens when doing Alt+letter : a fake 'down arrow' key press
...
...
@@ -1453,13 +1453,12 @@ INT16 X11DRV_ToAscii(
ret
=
TSXLookupString
(
&
e
,
(
LPVOID
)
lpChar
,
2
,
&
keysym
,
NULL
);
if
(
ret
==
0
)
{
BYTE
dead_char
=
0
;
BYTE
dead_char
;
((
char
*
)
lpChar
)[
1
]
=
'\0'
;
dead_char
=
KEYBOARD_MapDeadKeysym
(
keysym
);
if
(
dead_char
)
{
*
(
char
*
)
lpChar
=
dead_char
;
MultiByteToWideChar
(
main_key_tab
[
kbd_layout
].
layout_cp
,
0
,
&
dead_char
,
1
,
bufW
,
bufW_size
)
;
ret
=
-
1
;
}
else
...
...
@@ -1478,9 +1477,7 @@ INT16 X11DRV_ToAscii(
}
}
}
else
{
/* ret = 1 */
UINT
ansi_cp
=
GetACP
();
else
{
/* ret != 0 */
/* We have a special case to handle : Shift + arrow, shift + home, ...
X returns a char for it, but Windows doesn't. Let's eat it. */
if
(
!
(
lpKeyState
[
VK_NUMLOCK
]
&
0x01
)
/* NumLock is off */
...
...
@@ -1499,27 +1496,24 @@ INT16 X11DRV_ToAscii(
ret
=
0
;
}
/* perform translation to
the current ansi code pag
e */
if
(
ret
&&
ansi_cp
!=
main_key_tab
[
kbd_layout
].
layout_cp
)
/* perform translation to
unicod
e */
if
(
ret
)
{
WCHAR
uni_char
;
TRACE_
(
key
)(
"Translating char 0x%02x from cp %d to cp %d
\n
"
,
*
(
BYTE
*
)
lpChar
,
main_key_tab
[
kbd_layout
].
layout_cp
,
ansi_cp
);
MultiByteToWideChar
(
main_key_tab
[
kbd_layout
].
layout_cp
,
0
,
lpChar
,
1
,
&
uni_char
,
1
);
ret
=
WideCharToMultiByte
(
ansi_cp
,
0
,
&
uni_char
,
1
,
lpChar
,
2
,
NULL
,
NULL
);
TRACE_
(
key
)(
"Translation result: 0x%04x, 0x%02x (%d)
\n
"
,
uni_char
,
*
(
BYTE
*
)
lpChar
,
ret
);
TRACE_
(
key
)(
"Translating char 0x%02x from code page %d to unicode
\n
"
,
*
(
BYTE
*
)
lpChar
,
main_key_tab
[
kbd_layout
].
layout_cp
);
ret
=
MultiByteToWideChar
(
main_key_tab
[
kbd_layout
].
layout_cp
,
0
,
(
LPCSTR
)
lpChar
,
ret
,
bufW
,
bufW_size
);
}
}
TRACE_
(
key
)(
"To
Ascii about to return %d with char %x
\n
"
,
ret
,
*
(
BYTE
*
)
lpChar
);
TRACE_
(
key
)(
"To
Unicode about to return %d with char %x %s
\n
"
,
ret
,
bufW
?
bufW
[
1
]
:
0
,
bufW
?
""
:
"(no buffer)"
);
return
ret
;
}
/***********************************************************************
* X11DRV_GetBeepActive
*/
BOOL
X11DRV_GetBeepActive
()
BOOL
X11DRV_GetBeepActive
(
void
)
{
XKeyboardState
keyboard_state
;
...
...
@@ -1546,7 +1540,7 @@ void X11DRV_SetBeepActive(BOOL bActivate)
/***********************************************************************
* X11DRV_Beep
*/
void
X11DRV_Beep
()
void
X11DRV_Beep
(
void
)
{
TSXBell
(
display
,
0
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment