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
5bd55175
Commit
5bd55175
authored
Sep 03, 1999
by
Guy Albertelli
Committed by
Alexandre Julliard
Sep 03, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Completed GetKeyNameText for non-character keys.
parent
49f7643f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
6 deletions
+45
-6
keyboard.c
windows/x11drv/keyboard.c
+45
-6
No files found.
windows/x11drv/keyboard.c
View file @
5bd55175
...
...
@@ -273,6 +273,9 @@ static unsigned kbd_layout=0; /* index into above table of layouts */
keypad / and keypad ENTER (SDK 3.1 Vol.3 p 138) */
/* FIXME should we set extended bit for NumLock ? My
* Windows does ... DF */
/* Yes, to distinguish based on scan codes, also
for PrtScn key ... GA */
static
const
int
special_key_vkey
[]
=
{
VK_BACK
,
VK_TAB
,
0
,
VK_CLEAR
,
0
,
VK_RETURN
,
0
,
0
,
/* FF08 */
...
...
@@ -303,7 +306,7 @@ static const int misc_key_vkey[] =
};
static
const
int
misc_key_scan
[]
=
{
/*?*/
0
,
0x
37
,
/*?*/
0
,
0x152
,
0
,
0
,
0
,
0
,
/* FF60 */
/*?*/
0
,
0x
137
,
/*?*/
0
,
0x152
,
0
,
0
,
0
,
0
,
/* FF60 */
/*?*/
0
,
/*?*/
0
,
0x38
/* FF68 */
};
...
...
@@ -324,7 +327,7 @@ static const int keypad_key_vkey[] =
};
static
const
int
keypad_key_scan
[]
=
{
0x138
,
0x
45
,
/* FF7E */
0x138
,
0x
145
,
/* FF7E */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
/* FF80 */
0
,
0
,
0
,
0
,
0
,
0x11C
,
0
,
0
,
/* FF88 */
0
,
0
,
0
,
0
,
0
,
0x47
,
0x4B
,
0x48
,
/* FF90 */
...
...
@@ -1043,6 +1046,9 @@ UINT16 X11DRV_KEYBOARD_MapVirtualKey(UINT16 wCode, UINT16 wMapType)
INT16
X11DRV_KEYBOARD_GetKeyNameText
(
LONG
lParam
,
LPSTR
lpBuffer
,
INT16
nSize
)
{
int
vkey
,
ansi
,
scanCode
;
KeyCode
keyc
;
KeySym
keys
;
char
*
name
;
scanCode
=
lParam
>>
16
;
scanCode
&=
0x1ff
;
/* keep "extended-key" flag with code */
...
...
@@ -1074,8 +1080,14 @@ INT16 X11DRV_KEYBOARD_GetKeyNameText(LONG lParam, LPSTR lpBuffer, INT16 nSize)
TRACE_
(
keyboard
)(
"scan 0x%04x, vkey 0x%04x, ANSI 0x%04x
\n
"
,
scanCode
,
vkey
,
ansi
);
if
(
((
vkey
>=
0x30
)
&&
(
vkey
<=
0x39
))
||
(
(
vkey
>=
0x41
)
&&
(
vkey
<=
0x5a
))
)
/* Windows VK_* are ANSI codes */
/* first get the name of the "regular" keys which is the Upper case
value of the keycap imprint. */
if
(
((
ansi
>=
0x21
)
&&
(
ansi
<=
0x7e
))
&&
(
scanCode
!=
0x137
)
&&
/* PrtScn */
(
scanCode
!=
0x135
)
&&
/* numpad / */
(
scanCode
!=
0x37
)
&&
/* numpad * */
(
scanCode
!=
0x4a
)
&&
/* numpad - */
(
scanCode
!=
0x4e
)
)
/* numpad + */
{
if
((
nSize
>=
2
)
&&
lpBuffer
)
{
...
...
@@ -1087,10 +1099,37 @@ INT16 X11DRV_KEYBOARD_GetKeyNameText(LONG lParam, LPSTR lpBuffer, INT16 nSize)
return
0
;
}
/* use vkey values to construct names */
/* FIXME: horrible hack to fix function keys. Windows reports scancode
without "extended-key" flag. However Wine generates scancode
*with* "extended-key" flag. Seems to occur *only* for the
function keys. Soooo.. We will leave the table alone and
fudge the lookup here till the other part is found and fixed!!! */
if
(
((
scanCode
>=
0x13b
)
&&
(
scanCode
<=
0x144
))
||
(
scanCode
==
0x157
)
||
(
scanCode
==
0x158
))
scanCode
&=
0xff
;
/* remove "extended-key" flag for Fx keys */
/* let's do scancode -> keycode -> keysym -> String */
for
(
keyc
=
min_keycode
;
keyc
<=
max_keycode
;
keyc
++
)
if
((
keyc2scan
[
keyc
])
==
scanCode
)
break
;
if
(
keyc
<=
max_keycode
)
{
keys
=
TSXKeycodeToKeysym
(
display
,
keyc
,
0
);
name
=
TSXKeysymToString
(
keys
);
TRACE_
(
keyboard
)(
"found scan=%04x keyc=%04x keysym=%04x string=%s
\n
"
,
scanCode
,
keyc
,
(
int
)
keys
,
name
);
if
(
lpBuffer
&&
nSize
&&
name
)
{
strncpy
(
lpBuffer
,
name
,
nSize
);
return
1
;
}
}
FIXME_
(
keyboard
)(
"(%08lx,%p,%d): unsupported key
\n
"
,
lParam
,
lpBuffer
,
nSize
);
/* Finally issue FIXME for unknown keys */
FIXME_
(
keyboard
)(
"(%08lx,%p,%d): unsupported key, vkey=%04x, ansi=%04x
\n
"
,
lParam
,
lpBuffer
,
nSize
,
vkey
,
ansi
);
if
(
lpBuffer
&&
nSize
)
*
lpBuffer
=
0
;
return
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