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
43dc4116
Commit
43dc4116
authored
Apr 11, 2008
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 14, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Implement ImmProcessKey and ImmTranslateMessage.
parent
3dde049f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
2 deletions
+97
-2
imm.c
dlls/imm32/imm.c
+95
-0
imm32.spec
dlls/imm32/imm32.spec
+2
-2
No files found.
dlls/imm32/imm.c
View file @
43dc4116
...
...
@@ -78,6 +78,7 @@ typedef struct tagInputContextData
ImmHkl
*
immKbd
;
HWND
imeWnd
;
UINT
lastVK
;
}
InputContextData
;
typedef
struct
_tagTRANSMSG
{
...
...
@@ -2147,3 +2148,97 @@ BOOL WINAPI ImmGenerateMessage(HIMC hIMC)
return
TRUE
;
}
/***********************************************************************
* ImmTranslateMessage(IMM32.@)
* ( Undocumented, call internally and from user32.dll )
*/
BOOL
WINAPI
ImmTranslateMessage
(
HWND
hwnd
,
UINT
msg
,
WCHAR
chr
,
LPARAM
lKeyData
)
{
InputContextData
*
data
;
HIMC
imc
=
ImmGetContext
(
hwnd
);
BYTE
state
[
256
];
UINT
scancode
;
LPVOID
list
=
0
;
UINT
msg_count
;
UINT
uVirtKey
;
static
const
int
list_count
=
10
;
TRACE
(
"%p %x '%c' %x
\n
"
,
hwnd
,
msg
,
chr
,
(
UINT
)
lKeyData
);
if
(
imc
)
data
=
(
InputContextData
*
)
imc
;
else
return
FALSE
;
if
(
!
data
->
immKbd
->
hIME
||
!
data
->
immKbd
->
pImeToAsciiEx
)
return
FALSE
;
GetKeyboardState
(
state
);
scancode
=
lKeyData
>>
0x10
&
0xff
;
list
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
list_count
*
sizeof
(
TRANSMSG
)
+
sizeof
(
DWORD
));
((
DWORD
*
)
list
)[
0
]
=
list_count
;
if
(
data
->
immKbd
->
imeInfo
.
fdwProperty
&
IME_PROP_KBD_CHAR_FIRST
)
{
if
(
!
is_himc_ime_unicode
(
data
))
ToAscii
(
data
->
lastVK
,
scancode
,
state
,
&
chr
,
0
);
uVirtKey
=
MAKELONG
(
data
->
lastVK
,
chr
);
}
else
uVirtKey
=
data
->
lastVK
;
msg_count
=
data
->
immKbd
->
pImeToAsciiEx
(
uVirtKey
,
scancode
,
state
,
list
,
0
,
imc
);
TRACE
(
"%i messages generated
\n
"
,
msg_count
);
if
(
msg_count
&&
msg_count
<=
list_count
)
{
int
i
;
LPTRANSMSG
msgs
=
(
LPTRANSMSG
)((
LPBYTE
)
list
+
sizeof
(
DWORD
));
for
(
i
=
0
;
i
<
msg_count
;
i
++
)
ImmInternalPostIMEMessage
(
data
,
msgs
[
i
].
message
,
msgs
[
i
].
wParam
,
msgs
[
i
].
lParam
);
}
else
if
(
msg_count
>
list_count
)
ImmGenerateMessage
(
imc
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
return
(
msg_count
>
0
);
}
/***********************************************************************
* ImmProcessKey(IMM32.@)
* ( Undocumented, called from user32.dll )
*/
BOOL
WINAPI
ImmProcessKey
(
HWND
hwnd
,
HKL
hKL
,
UINT
vKey
,
LPARAM
lKeyData
,
DWORD
unknown
)
{
InputContextData
*
data
;
HIMC
imc
=
ImmGetContext
(
hwnd
);
BYTE
state
[
256
];
TRACE
(
"%p %p %x %x %x
\n
"
,
hwnd
,
hKL
,
vKey
,
(
UINT
)
lKeyData
,
unknown
);
if
(
imc
)
data
=
(
InputContextData
*
)
imc
;
else
return
FALSE
;
if
(
!
data
->
immKbd
->
hIME
||
!
data
->
immKbd
->
pImeProcessKey
)
return
FALSE
;
GetKeyboardState
(
state
);
data
->
lastVK
=
vKey
;
if
(
data
->
immKbd
->
pImeProcessKey
(
imc
,
vKey
,
lKeyData
,
state
))
{
WCHAR
key
;
UINT
scancode
;
scancode
=
lKeyData
>>
0x10
&
0xff
;
ToUnicodeEx
(
vKey
,
scancode
,
state
,
&
key
,
1
,
0
,
hKL
);
return
ImmTranslateMessage
(
hwnd
,
WM_KEYDOWN
,
key
,
lKeyData
);
}
return
FALSE
;
}
dlls/imm32/imm32.spec
View file @
43dc4116
...
...
@@ -72,7 +72,7 @@
@ stub ImmLockImeDpi
@ stdcall ImmNotifyIME(long long long long)
@ stub ImmPenAuxInput
@ st
ub ImmProcessKey
@ st
dcall ImmProcessKey(long long long long long)
@ stub ImmPutImeMenuItemsIntoMappedFile
@ stdcall ImmReSizeIMCC(long long)
@ stub ImmRegisterClient
...
...
@@ -99,7 +99,7 @@
@ stub ImmShowSoftKeyboard
@ stdcall ImmSimulateHotKey(long long)
@ stub ImmSystemHandler
@ st
ub ImmTranslateMessage
@ st
dcall ImmTranslateMessage(long long long long)
@ stub ImmUnlockClientImc
@ stdcall ImmUnlockIMC(long)
@ stdcall ImmUnlockIMCC(long)
...
...
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