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
6f4149d8
Commit
6f4149d8
authored
Jun 08, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineandroid: Implement ToUnicodeEx.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8dc11a3a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
0 deletions
+96
-0
keyboard.c
dlls/wineandroid.drv/keyboard.c
+95
-0
wineandroid.drv.spec
dlls/wineandroid.drv/wineandroid.drv.spec
+1
-0
No files found.
dlls/wineandroid.drv/keyboard.c
View file @
6f4149d8
...
...
@@ -32,6 +32,7 @@
#include "config.h"
#include "android.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
keyboard
);
...
...
@@ -554,3 +555,97 @@ jboolean keyboard_event( JNIEnv *env, jobject obj, jint win, jint action, jint k
send_event
(
&
data
);
return
JNI_TRUE
;
}
/***********************************************************************
* ANDROID_ToUnicodeEx
*/
INT
CDECL
ANDROID_ToUnicodeEx
(
UINT
virt
,
UINT
scan
,
const
BYTE
*
state
,
LPWSTR
buf
,
int
size
,
UINT
flags
,
HKL
hkl
)
{
WCHAR
buffer
[
2
];
BOOL
shift
=
(
state
[
VK_SHIFT
]
&
0x80
)
||
(
state
[
VK_CAPITAL
]
&
0x01
);
BOOL
ctrl
=
state
[
VK_CONTROL
]
&
0x80
;
BOOL
numlock
=
state
[
VK_NUMLOCK
]
&
0x01
;
buffer
[
0
]
=
buffer
[
1
]
=
0
;
if
(
scan
&
0x8000
)
return
0
;
/* key up */
/* FIXME: hardcoded layout */
if
(
!
ctrl
)
{
switch
(
virt
)
{
case
VK_BACK
:
buffer
[
0
]
=
'\b'
;
break
;
case
VK_OEM_1
:
buffer
[
0
]
=
shift
?
':'
:
';'
;
break
;
case
VK_OEM_2
:
buffer
[
0
]
=
shift
?
'?'
:
'/'
;
break
;
case
VK_OEM_3
:
buffer
[
0
]
=
shift
?
'~'
:
'`'
;
break
;
case
VK_OEM_4
:
buffer
[
0
]
=
shift
?
'{'
:
'['
;
break
;
case
VK_OEM_5
:
buffer
[
0
]
=
shift
?
'|'
:
'\\'
;
break
;
case
VK_OEM_6
:
buffer
[
0
]
=
shift
?
'}'
:
']'
;
break
;
case
VK_OEM_7
:
buffer
[
0
]
=
shift
?
'"'
:
'\''
;
break
;
case
VK_OEM_COMMA
:
buffer
[
0
]
=
shift
?
'<'
:
','
;
break
;
case
VK_OEM_MINUS
:
buffer
[
0
]
=
shift
?
'_'
:
'-'
;
break
;
case
VK_OEM_PERIOD
:
buffer
[
0
]
=
shift
?
'>'
:
'.'
;
break
;
case
VK_OEM_PLUS
:
buffer
[
0
]
=
shift
?
'+'
:
'='
;
break
;
case
VK_RETURN
:
buffer
[
0
]
=
'\r'
;
break
;
case
VK_SPACE
:
buffer
[
0
]
=
' '
;
break
;
case
VK_TAB
:
buffer
[
0
]
=
'\t'
;
break
;
case
VK_MULTIPLY
:
buffer
[
0
]
=
'*'
;
break
;
case
VK_ADD
:
buffer
[
0
]
=
'+'
;
break
;
case
VK_SUBTRACT
:
buffer
[
0
]
=
'-'
;
break
;
case
VK_DIVIDE
:
buffer
[
0
]
=
'/'
;
break
;
default:
if
(
virt
>=
'0'
&&
virt
<=
'9'
)
{
buffer
[
0
]
=
shift
?
")!@#$%^&*("
[
virt
-
'0'
]
:
virt
;
break
;
}
if
(
virt
>=
'A'
&&
virt
<=
'Z'
)
{
buffer
[
0
]
=
shift
?
virt
:
virt
+
'a'
-
'A'
;
break
;
}
if
(
virt
>=
VK_NUMPAD0
&&
virt
<=
VK_NUMPAD9
&&
numlock
&&
!
shift
)
{
buffer
[
0
]
=
'0'
+
virt
-
VK_NUMPAD0
;
break
;
}
if
(
virt
==
VK_DECIMAL
&&
numlock
&&
!
shift
)
{
buffer
[
0
]
=
'.'
;
break
;
}
break
;
}
}
else
/* Control codes */
{
if
(
virt
>=
'A'
&&
virt
<=
'Z'
)
buffer
[
0
]
=
virt
-
'A'
+
1
;
else
{
switch
(
virt
)
{
case
VK_OEM_4
:
buffer
[
0
]
=
0x1b
;
break
;
case
VK_OEM_5
:
buffer
[
0
]
=
0x1c
;
break
;
case
VK_OEM_6
:
buffer
[
0
]
=
0x1d
;
break
;
case
VK_SUBTRACT
:
buffer
[
0
]
=
0x1e
;
break
;
}
}
}
lstrcpynW
(
buf
,
buffer
,
size
);
TRACE
(
"returning %d / %s
\n
"
,
strlenW
(
buffer
),
debugstr_wn
(
buf
,
strlenW
(
buffer
)));
return
strlenW
(
buffer
);
}
dlls/wineandroid.drv/wineandroid.drv.spec
View file @
6f4149d8
...
...
@@ -4,6 +4,7 @@
# USER driver
@ cdecl ToUnicodeEx(long long ptr ptr long long long) ANDROID_ToUnicodeEx
@ cdecl EnumDisplayMonitors(long ptr ptr long) ANDROID_EnumDisplayMonitors
@ cdecl GetMonitorInfo(long ptr) ANDROID_GetMonitorInfo
@ cdecl CreateWindow(long) ANDROID_CreateWindow
...
...
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