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
1c96ed9b
Commit
1c96ed9b
authored
May 01, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
May 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Clear vkey before calling ToAsciiEx in ImmTranslateMessage.
parent
bfb7799b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
32 deletions
+18
-32
imm.c
dlls/imm32/imm.c
+17
-31
imm32.c
dlls/imm32/tests/imm32.c
+1
-1
No files found.
dlls/imm32/imm.c
View file @
1c96ed9b
...
...
@@ -85,8 +85,8 @@ struct imc
DWORD
dwLock
;
INPUTCONTEXT
IMC
;
struct
ime
*
ime
;
UINT
lastVK
;
struct
ime
*
ime
;
UINT
vkey
;
HWND
ui_hwnd
;
/* IME UI window, on the default input context */
};
...
...
@@ -2111,27 +2111,15 @@ BOOL WINAPI ImmGetStatusWindowPos( HIMC himc, POINT *pos )
/***********************************************************************
* ImmGetVirtualKey (IMM32.@)
*/
UINT
WINAPI
ImmGetVirtualKey
(
HWND
hWnd
)
{
OSVERSIONINFOA
version
;
struct
imc
*
data
=
get_imc_data
(
ImmGetContext
(
hWnd
)
);
TRACE
(
"%p
\n
"
,
hWnd
);
if
(
data
)
return
data
->
lastVK
;
version
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOA
);
GetVersionExA
(
&
version
);
switch
(
version
.
dwPlatformId
)
{
case
VER_PLATFORM_WIN32_WINDOWS
:
return
VK_PROCESSKEY
;
case
VER_PLATFORM_WIN32_NT
:
return
0
;
default:
FIXME
(
"%ld not supported
\n
"
,
version
.
dwPlatformId
);
return
VK_PROCESSKEY
;
}
UINT
WINAPI
ImmGetVirtualKey
(
HWND
hwnd
)
{
HIMC
himc
=
ImmGetContext
(
hwnd
);
struct
imc
*
imc
;
TRACE
(
"%p
\n
"
,
hwnd
);
if
((
imc
=
get_imc_data
(
himc
)))
return
imc
->
vkey
;
return
VK_PROCESSKEY
;
}
/***********************************************************************
...
...
@@ -3127,17 +3115,17 @@ BOOL WINAPI ImmTranslateMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
if
(
msg
<
WM_KEYDOWN
||
msg
>
WM_KEYUP
)
return
FALSE
;
if
(
!
(
data
=
get_imc_data
(
ImmGetContext
(
hwnd
)
)))
return
FALSE
;
if
(
!
(
ime
=
imc_select_ime
(
data
)))
return
FALSE
;
if
(
data
->
lastVK
==
VK_PROCESSKEY
)
return
FALSE
;
if
((
vkey
=
data
->
vkey
)
==
VK_PROCESSKEY
)
return
FALSE
;
data
->
vkey
=
VK_PROCESSKEY
;
GetKeyboardState
(
state
);
scan
=
lparam
>>
0x10
&
0xff
;
vkey
=
data
->
lastVK
;
if
(
ime
->
info
.
fdwProperty
&
IME_PROP_KBD_CHAR_FIRST
)
{
if
(
!
ime_is_unicode
(
ime
))
ToAscii
(
data
->
lastVK
,
scan
,
state
,
&
chr
,
0
);
else
ToUnicodeEx
(
data
->
lastVK
,
scan
,
state
,
&
chr
,
1
,
0
,
GetKeyboardLayout
(
0
)
);
vkey
=
MAKELONG
(
data
->
lastVK
,
chr
);
if
(
!
ime_is_unicode
(
ime
))
ToAscii
(
vkey
,
scan
,
state
,
&
chr
,
0
);
else
ToUnicodeEx
(
vkey
,
scan
,
state
,
&
chr
,
1
,
0
,
GetKeyboardLayout
(
0
)
);
vkey
=
MAKELONG
(
vkey
,
chr
);
}
count
=
ime
->
pImeToAsciiEx
(
vkey
,
scan
,
state
,
&
buffer
.
list
,
0
,
data
->
handle
);
...
...
@@ -3146,8 +3134,6 @@ BOOL WINAPI ImmTranslateMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
if
(
count
>
ARRAY_SIZE
(
buffer
.
TransMsg
))
ImmGenerateMessage
(
data
->
handle
);
else
for
(
i
=
0
;
i
<
count
;
i
++
)
imc_post_message
(
data
,
buffer
.
TransMsg
+
i
);
data
->
lastVK
=
VK_PROCESSKEY
;
return
count
>
0
;
}
...
...
@@ -3171,7 +3157,7 @@ BOOL WINAPI ImmProcessKey( HWND hwnd, HKL hkl, UINT vkey, LPARAM lparam, DWORD u
GetKeyboardState
(
state
);
ret
=
ime
->
pImeProcessKey
(
imc
->
handle
,
vkey
,
lparam
,
state
);
imc
->
lastVK
=
ret
?
vkey
:
VK_PROCESSKEY
;
imc
->
vkey
=
ret
?
vkey
:
VK_PROCESSKEY
;
return
ret
;
}
...
...
dlls/imm32/tests/imm32.c
View file @
1c96ed9b
...
...
@@ -3457,7 +3457,7 @@ static UINT WINAPI ime_ImeToAsciiEx( UINT vkey, UINT vsc, BYTE *state, TRANSMSGL
todo_wine
ok_eq
(
256
,
msgs
->
uMsgCount
,
UINT
,
"%u"
);
ctx
=
ImmLockIMC
(
himc
);
todo_wine
ok_ret
(
VK_PROCESSKEY
,
ImmGetVirtualKey
(
ctx
->
hWnd
)
);
ok_ret
(
VK_PROCESSKEY
,
ImmGetVirtualKey
(
ctx
->
hWnd
)
);
if
(
vsc
&
0x200
)
{
...
...
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