Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
80baa3a0
Commit
80baa3a0
authored
Feb 06, 2013
by
Ken Thomases
Committed by
Alexandre Julliard
Feb 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Implement VkKeyScanEx().
parent
a649d845
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
0 deletions
+74
-0
keyboard.c
dlls/winemac.drv/keyboard.c
+73
-0
winemac.drv.spec
dlls/winemac.drv/winemac.drv.spec
+1
-0
No files found.
dlls/winemac.drv/keyboard.c
View file @
80baa3a0
...
...
@@ -1087,3 +1087,76 @@ done:
TRACE_
(
key
)(
"returning %d / %s
\n
"
,
ret
,
debugstr_wn
(
bufW
,
abs
(
ret
)));
return
ret
;
}
/***********************************************************************
* VkKeyScanEx (MACDRV.@)
*
* Note: Windows ignores HKL parameter and uses current active layout instead
*/
SHORT
CDECL
macdrv_VkKeyScanEx
(
WCHAR
wChar
,
HKL
hkl
)
{
struct
macdrv_thread_data
*
thread_data
=
macdrv_init_thread_data
();
SHORT
ret
=
-
1
;
int
state
;
const
UCKeyboardLayout
*
uchr
;
TRACE
(
"%04x, %p
\n
"
,
wChar
,
hkl
);
uchr
=
(
const
UCKeyboardLayout
*
)
CFDataGetBytePtr
(
thread_data
->
keyboard_layout_uchr
);
if
(
!
uchr
)
{
TRACE
(
"no keyboard layout UCHR data; returning -1
\n
"
);
return
-
1
;
}
for
(
state
=
0
;
state
<
8
;
state
++
)
{
UInt32
modifierKeyState
=
0
;
int
keyc
;
if
(
state
&
1
)
modifierKeyState
|=
(
shiftKey
>>
8
);
if
((
state
&
6
)
==
6
)
modifierKeyState
|=
(
optionKey
>>
8
);
else
{
if
(
state
&
2
)
modifierKeyState
|=
(
controlKey
>>
8
);
if
(
state
&
4
)
modifierKeyState
|=
(
cmdKey
>>
8
);
}
for
(
keyc
=
0
;
keyc
<
sizeof
(
thread_data
->
keyc2vkey
)
/
sizeof
(
thread_data
->
keyc2vkey
[
0
]);
keyc
++
)
{
UInt32
deadKeyState
=
0
;
UniChar
uchar
;
UniCharCount
len
;
OSStatus
status
;
if
(
!
thread_data
->
keyc2vkey
[
keyc
])
continue
;
status
=
UCKeyTranslate
(
uchr
,
keyc
,
kUCKeyActionDown
,
modifierKeyState
,
thread_data
->
keyboard_type
,
0
,
&
deadKeyState
,
1
,
&
len
,
&
uchar
);
if
(
status
==
noErr
&&
len
==
1
&&
uchar
==
wChar
)
{
WORD
vkey
=
thread_data
->
keyc2vkey
[
keyc
];
ret
=
vkey
|
(
state
<<
8
);
if
((
VK_NUMPAD0
<=
vkey
&&
vkey
<=
VK_DIVIDE
)
||
keyc
==
kVK_ANSI_KeypadClear
||
keyc
==
kVK_ANSI_KeypadEnter
||
keyc
==
kVK_ANSI_KeypadEquals
)
{
/* Keep searching for a non-numpad match, which is preferred. */
}
else
goto
done
;
}
}
}
done:
TRACE
(
" -> 0x%04x
\n
"
,
ret
);
return
ret
;
}
dlls/winemac.drv/winemac.drv.spec
View file @
80baa3a0
...
...
@@ -22,6 +22,7 @@
@ cdecl ShowWindow(long long ptr long) macdrv_ShowWindow
@ cdecl ToUnicodeEx(long long ptr ptr long long long) macdrv_ToUnicodeEx
@ cdecl UpdateLayeredWindow(long ptr ptr) macdrv_UpdateLayeredWindow
@ cdecl VkKeyScanEx(long long) macdrv_VkKeyScanEx
@ cdecl WindowMessage(long long long long) macdrv_WindowMessage
@ cdecl WindowPosChanged(long long long ptr ptr ptr ptr ptr) macdrv_WindowPosChanged
@ cdecl WindowPosChanging(long long long ptr ptr ptr ptr) macdrv_WindowPosChanging
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