[PATCH v12 0/5] MR9992: Introduce ImeToAsciiEx() user driver function for use in winemac
-- v12: win32u: Remove builtin WINE_IME_PROCESS_KEY driver call. winemac: Move macdrv_ImeProcessKey logic to ImeProcessKey and macdrv_ImeToAsciiEx. winemac: Implement and use macdrv_ImeToAsciiEx(). win32u: Move IME processing to ImeToAsciiEx. win32u: Introduce new ImeToAsciiEx user driver call. https://gitlab.winehq.org/wine/wine/-/merge_requests/9992
From: Marc-Aurel Zent <mzent@codeweavers.com> --- dlls/win32u/driver.c | 12 ++++++++++++ include/wine/gdi_driver.h | 1 + 2 files changed, 13 insertions(+) diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index c9e81016ee8..36f0205b8b3 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -675,6 +675,11 @@ static UINT nulldrv_ImeProcessKey( HIMC himc, UINT wparam, UINT lparam, const BY return 0; } +static UINT nulldrv_ImeToAsciiEx( UINT vkey, UINT vsc, const BYTE *state, HIMC himc ) +{ + return STATUS_NOT_IMPLEMENTED; +} + static void nulldrv_NotifyIMEStatus( HWND hwnd, UINT status ) { } @@ -1102,6 +1107,11 @@ static UINT loaderdrv_ImeProcessKey( HIMC himc, UINT wparam, UINT lparam, const return load_driver()->pImeProcessKey( himc, wparam, lparam, state ); } +static UINT loaderdrv_ImeToAsciiEx( UINT vkey, UINT vsc,const BYTE *state, HIMC himc ) +{ + return load_driver()->pImeToAsciiEx( vkey, vsc, state, himc ); +} + static void loaderdrv_NotifyIMEStatus( HWND hwnd, UINT status ) { return load_driver()->pNotifyIMEStatus( hwnd, status ); @@ -1255,6 +1265,7 @@ static const struct user_driver_funcs lazy_load_driver = loaderdrv_KbdLayerDescriptor, loaderdrv_ReleaseKbdTables, loaderdrv_ImeProcessKey, + loaderdrv_ImeToAsciiEx, loaderdrv_NotifyIMEStatus, loaderdrv_SetIMECompositionRect, /* cursor/icon functions */ @@ -1359,6 +1370,7 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version SET_USER_FUNC(KbdLayerDescriptor); SET_USER_FUNC(ReleaseKbdTables); SET_USER_FUNC(ImeProcessKey); + SET_USER_FUNC(ImeToAsciiEx); SET_USER_FUNC(NotifyIMEStatus); SET_USER_FUNC(SetIMECompositionRect); SET_USER_FUNC(DestroyCursorIcon); diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index f6390bce878..c5b200fb935 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -373,6 +373,7 @@ struct user_driver_funcs void (*pReleaseKbdTables)(const KBDTABLES *); /* IME functions */ UINT (*pImeProcessKey)(HIMC,UINT,UINT,const BYTE*); + UINT (*pImeToAsciiEx)(UINT,UINT,const BYTE*,HIMC); void (*pNotifyIMEStatus)(HWND,UINT); BOOL (*pSetIMECompositionRect)(HWND,RECT); /* cursor/icon functions */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9992
From: Marc-Aurel Zent <mzent@codeweavers.com> --- dlls/imm32/ime.c | 10 ++++++++-- dlls/win32u/driver.c | 2 +- dlls/win32u/imm.c | 42 +++++++++++++++++++++++------------------- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/dlls/imm32/ime.c b/dlls/imm32/ime.c index 9e6c96537c8..95a463e15c5 100644 --- a/dlls/imm32/ime.c +++ b/dlls/imm32/ime.c @@ -563,6 +563,7 @@ UINT WINAPI ImeToAsciiEx( UINT vkey, UINT vsc, BYTE *state, TRANSMSGLIST *msgs, INPUTCONTEXT *ctx; NTSTATUS status; BOOL key_consumed = TRUE; + struct ime_driver_call_params params = {.himc = himc, .state = state}; TRACE( "vkey %#x, vsc %#x, state %p, msgs %p, flags %#x, himc %p\n", vkey, vsc, state, msgs, flags, himc ); @@ -575,7 +576,6 @@ UINT WINAPI ImeToAsciiEx( UINT vkey, UINT vsc, BYTE *state, TRANSMSGLIST *msgs, do { - struct ime_driver_call_params params = {.himc = himc, .state = state}; HIMCC himcc; ImmUnlockIMCC( ctx->hCompStr ); @@ -587,9 +587,15 @@ UINT WINAPI ImeToAsciiEx( UINT vkey, UINT vsc, BYTE *state, TRANSMSGLIST *msgs, status = NtUserMessageCall( ctx->hWnd, WINE_IME_TO_ASCII_EX, vkey, vsc, ¶ms, NtUserImeDriverCall, FALSE ); size = compstr->dwSize; + params.state = NULL; } while (status == STATUS_BUFFER_TOO_SMALL); - if (status) WARN( "WINE_IME_TO_ASCII_EX returned status %#lx\n", status ); + if (status == STATUS_NOT_IMPLEMENTED) + { + TRANSMSG msg = {.message = vsc & KF_UP ? WM_KEYUP : WM_KEYDOWN, .wParam = vkey, .lParam = vsc}; + msgs->TransMsg[count++] = msg; + } + else if (status) WARN( "WINE_IME_TO_ASCII_EX returned unexpected status %#lx\n", status ); else { if (compstr->dwCompStrOffset || compstr->dwResultStrLen) diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 36f0205b8b3..40ccdefc6e0 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -672,7 +672,7 @@ static void nulldrv_ReleaseKbdTables( const KBDTABLES *tables ) static UINT nulldrv_ImeProcessKey( HIMC himc, UINT wparam, UINT lparam, const BYTE *state ) { - return 0; + return 1; } static UINT nulldrv_ImeToAsciiEx( UINT vkey, UINT vsc, const BYTE *state, HIMC himc ) diff --git a/dlls/win32u/imm.c b/dlls/win32u/imm.c index f585b80a383..68e19bc7a68 100644 --- a/dlls/win32u/imm.c +++ b/dlls/win32u/imm.c @@ -664,28 +664,32 @@ LRESULT ime_driver_call( HWND hwnd, enum wine_ime_call call, WPARAM wparam, LPAR switch (call) { case WINE_IME_PROCESS_KEY: - { - struct imm_thread_data *data = get_imm_thread_data(); - - data->ime_process_scan = HIWORD(lparam); - data->ime_process_vkey = LOWORD(wparam); res = user_driver->pImeProcessKey( params->himc, wparam, lparam, params->state ); - data->ime_process_vkey = data->ime_process_scan = 0; - - if (data->update) - { - data->update->key_consumed = res; - pthread_mutex_lock( &imm_mutex ); - list_add_tail( &ime_updates, &data->update->entry ); - pthread_mutex_unlock( &imm_mutex ); - data->update = NULL; - res = TRUE; - } - - TRACE( "processing vkey %#x, scan %#x -> %lu\n", LOWORD(wparam), HIWORD(lparam), res ); + TRACE( "ImeProcessKey vkey %#x, scan %#x -> %lu\n", LOWORD(wparam), HIWORD(lparam), res ); return res; - } case WINE_IME_TO_ASCII_EX: + if (params->state) + { + struct imm_thread_data *data = get_imm_thread_data(); + + data->ime_process_scan = LOWORD(lparam); + data->ime_process_vkey = LOWORD(wparam); + res = user_driver->pImeToAsciiEx( wparam, lparam, params->state, params->himc ); + data->ime_process_vkey = data->ime_process_scan = 0; + + if (data->update) + { + data->update->key_consumed = !res; + pthread_mutex_lock( &imm_mutex ); + list_add_tail( &ime_updates, &data->update->entry ); + pthread_mutex_unlock( &imm_mutex ); + data->update = NULL; + res = STATUS_SUCCESS; + } + + TRACE( "processing vkey %#x, scan %#x -> %lu\n", LOWORD(wparam), LOWORD(lparam), res ); + if (res) return res; + } return ime_to_tascii_ex( wparam, lparam, params->state, params->compstr, params->key_consumed, params->himc ); case WINE_IME_POST_UPDATE: post_ime_update( hwnd, wparam, (WCHAR *)lparam, (WCHAR *)params ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9992
From: Marc-Aurel Zent <mzent@codeweavers.com> Also renames back macdrv_ime_process_key to macdrv_send_keydown_to_input_source, which is a more accurate name for the function. --- dlls/winemac.drv/cocoa_window.m | 4 +-- dlls/winemac.drv/gdi.c | 1 + dlls/winemac.drv/keyboard.c | 47 ++++++++++++++++++++++----------- dlls/winemac.drv/macdrv.h | 1 + dlls/winemac.drv/macdrv_cocoa.h | 2 +- 5 files changed, 37 insertions(+), 18 deletions(-) diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 7d6d704436c..4c1ac93524f 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -4034,13 +4034,13 @@ uint32_t macdrv_window_background_color(void) } /*********************************************************************** - * macdrv_ime_process_key + * macdrv_send_keydown_to_input_source * * Sends a key down event to the active window's inputContext so that it can be * processed by input sources (AKA IMEs). This is only called when there is an * active non-keyboard input source. */ -bool macdrv_ime_process_key(int keyc, unsigned int flags, int repeat, void *himc) +bool macdrv_send_keydown_to_input_source(int keyc, unsigned int flags, int repeat, void *himc) { __block bool ret; diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c index 2ef941aedb4..1bf703459f5 100644 --- a/dlls/winemac.drv/gdi.c +++ b/dlls/winemac.drv/gdi.c @@ -278,6 +278,7 @@ static const struct user_driver_funcs macdrv_funcs = .pUpdateLayeredWindow = macdrv_UpdateLayeredWindow, .pVkKeyScanEx = macdrv_VkKeyScanEx, .pImeProcessKey = macdrv_ImeProcessKey, + .pImeToAsciiEx = macdrv_ImeToAsciiEx, .pNotifyIMEStatus = macdrv_NotifyIMEStatus, .pSetIMECompositionRect = macdrv_SetIMECompositionRect, .pWindowMessage = macdrv_WindowMessage, diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c index fb3c9bcf30e..962a8c50896 100644 --- a/dlls/winemac.drv/keyboard.c +++ b/dlls/winemac.drv/keyboard.c @@ -1110,15 +1110,11 @@ void macdrv_hotkey_press(const macdrv_event *event) */ UINT macdrv_ImeProcessKey(HIMC himc, UINT wparam, UINT lparam, const BYTE *key_state) { - struct macdrv_thread_data *thread_data = macdrv_thread_data(); - WORD scan = HIWORD(lparam) & 0x1ff, vkey = LOWORD(wparam); - BOOL repeat = !!(lparam >> 30), pressed = !(lparam >> 31); - unsigned int flags; - int keyc; - UINT ret; + WORD vkey = LOWORD(wparam); + BOOL pressed = !(lparam >> 31); - TRACE("himc %p, scan %#x, vkey %#x, repeat %u, pressed %u\n", - himc, scan, vkey, repeat, pressed); + TRACE("himc %p, vkey %#x, pressed %u\n", + himc, vkey, pressed); if (!macdrv_using_input_method()) return 0; @@ -1136,23 +1132,45 @@ UINT macdrv_ImeProcessKey(HIMC himc, UINT wparam, UINT lparam, const BYTE *key_s case VK_CONTROL: case VK_CAPITAL: case VK_MENU: + case VK_KANA: + case VK_KANJI: + TRACE("Skipping metakey\n"); return 0; } + return 1; +} + +/*********************************************************************** + * ImeToAsciiEx (MACDRV.@) + */ +UINT macdrv_ImeToAsciiEx(UINT vkey, UINT vsc, const BYTE *state, HIMC himc) +{ + struct macdrv_thread_data *thread_data = macdrv_thread_data(); + unsigned int flags; + int keyc; + bool ret; + BOOL repeat = !!(vsc & 0x4000); + + TRACE("himc %p, vkey %#x state %p repeat %u\n", + himc, vkey, state, repeat); + + if (!state) return 0; + flags = thread_data->last_modifiers; - if (key_state[VK_SHIFT] & 0x80) + if (state[VK_SHIFT] & 0x80) flags |= NX_SHIFTMASK; else flags &= ~(NX_SHIFTMASK | NX_DEVICELSHIFTKEYMASK | NX_DEVICERSHIFTKEYMASK); - if (key_state[VK_CAPITAL] & 0x01) + if (state[VK_CAPITAL] & 0x01) flags |= NX_ALPHASHIFTMASK; else flags &= ~NX_ALPHASHIFTMASK; - if (key_state[VK_CONTROL] & 0x80) + if (state[VK_CONTROL] & 0x80) flags |= NX_CONTROLMASK; else flags &= ~(NX_CONTROLMASK | NX_DEVICELCTLKEYMASK | NX_DEVICERCTLKEYMASK); - if (key_state[VK_MENU] & 0x80) + if (state[VK_MENU] & 0x80) flags |= NX_COMMANDMASK; else flags &= ~(NX_COMMANDMASK | NX_DEVICELCMDKEYMASK | NX_DEVICERCMDKEYMASK); @@ -1164,10 +1182,9 @@ UINT macdrv_ImeProcessKey(HIMC himc, UINT wparam, UINT lparam, const BYTE *key_s if (keyc >= ARRAY_SIZE(thread_data->keyc2vkey)) return 0; TRACE("flags 0x%08x keyc 0x%04x\n", flags, keyc); - ret = (UINT)macdrv_ime_process_key(keyc, flags, repeat, himc); + ret = macdrv_send_keydown_to_input_source(keyc, flags, repeat, himc); NtUserMsgWaitForMultipleObjectsEx(0, NULL, 0, QS_POSTMESSAGE | QS_SENDMESSAGE, 0); - TRACE("returning %u\n", ret); - return ret; + return ret ? STATUS_SUCCESS : STATUS_NOT_IMPLEMENTED; } diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 0ef7a706d91..e5c922296bf 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -159,6 +159,7 @@ extern void macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hin extern void macdrv_UnregisterHotKey(HWND hwnd, UINT modifiers, UINT vkey); extern SHORT macdrv_VkKeyScanEx(WCHAR wChar, HKL hkl); extern UINT macdrv_ImeProcessKey(HIMC himc, UINT wparam, UINT lparam, const BYTE *state); +extern UINT macdrv_ImeToAsciiEx(UINT vkey, UINT vsc, const BYTE *state, HIMC himc); extern UINT macdrv_MapVirtualKeyEx(UINT wCode, UINT wMapType, HKL hkl); extern INT macdrv_ToUnicodeEx(UINT virtKey, UINT scanCode, const BYTE *lpKeyState, LPWSTR bufW, int bufW_size, UINT flags, HKL hkl); diff --git a/dlls/winemac.drv/macdrv_cocoa.h b/dlls/winemac.drv/macdrv_cocoa.h index 6a6b6975f55..381808479ce 100644 --- a/dlls/winemac.drv/macdrv_cocoa.h +++ b/dlls/winemac.drv/macdrv_cocoa.h @@ -530,7 +530,7 @@ extern void macdrv_order_cocoa_window(macdrv_window w, macdrv_window prev, extern bool macdrv_get_view_backing_size(macdrv_view v, int backing_size[2]); extern void macdrv_set_view_backing_size(macdrv_view v, const int backing_size[2]); extern uint32_t macdrv_window_background_color(void); -extern bool macdrv_ime_process_key(int keyc, unsigned int flags, int repeat, void *data); +extern bool macdrv_send_keydown_to_input_source(int keyc, unsigned int flags, int repeat, void *data); extern bool macdrv_is_any_wine_window_visible(void); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9992
From: Marc-Aurel Zent <mzent@codeweavers.com> --- dlls/imm32/ime.c | 8 +++++++ dlls/winemac.drv/keyboard.c | 48 ++++++++++++++----------------------- 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/dlls/imm32/ime.c b/dlls/imm32/ime.c index 95a463e15c5..4b84424c24d 100644 --- a/dlls/imm32/ime.c +++ b/dlls/imm32/ime.c @@ -551,6 +551,14 @@ BOOL WINAPI ImeProcessKey( HIMC himc, UINT vkey, LPARAM lparam, BYTE *state ) if (!(ctx = ImmLockIMC( himc ))) return FALSE; ret = NtUserMessageCall( ctx->hWnd, WINE_IME_PROCESS_KEY, vkey, lparam, ¶ms, NtUserImeDriverCall, FALSE ); + switch (LOWORD(vkey)) + { + case VK_SHIFT: + case VK_CONTROL: + case VK_CAPITAL: + case VK_MENU: + ret = FALSE; + } ImmUnlockIMC( himc ); return ret; diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c index 962a8c50896..dc064ad4823 100644 --- a/dlls/winemac.drv/keyboard.c +++ b/dlls/winemac.drv/keyboard.c @@ -1110,34 +1110,6 @@ void macdrv_hotkey_press(const macdrv_event *event) */ UINT macdrv_ImeProcessKey(HIMC himc, UINT wparam, UINT lparam, const BYTE *key_state) { - WORD vkey = LOWORD(wparam); - BOOL pressed = !(lparam >> 31); - - TRACE("himc %p, vkey %#x, pressed %u\n", - himc, vkey, pressed); - - if (!macdrv_using_input_method()) return 0; - - if (!pressed) - { - /* Only key down events should be sent to the Cocoa input context. We do - not handle key ups, and instead let those go through as a normal - WM_KEYUP. */ - return 0; - } - - switch (vkey) - { - case VK_SHIFT: - case VK_CONTROL: - case VK_CAPITAL: - case VK_MENU: - case VK_KANA: - case VK_KANJI: - TRACE("Skipping metakey\n"); - return 0; - } - return 1; } @@ -1150,12 +1122,28 @@ UINT macdrv_ImeToAsciiEx(UINT vkey, UINT vsc, const BYTE *state, HIMC himc) unsigned int flags; int keyc; bool ret; - BOOL repeat = !!(vsc & 0x4000); + BOOL repeat = !!(vsc & KF_REPEAT); TRACE("himc %p, vkey %#x state %p repeat %u\n", himc, vkey, state, repeat); - if (!state) return 0; + if (!state) return STATUS_SUCCESS; + + if (vsc & KF_UP) + { + /* Only key down events should be sent to the Cocoa input context. We do + not handle key ups, and instead let those go through as a normal + WM_KEYUP. */ + return STATUS_NOT_IMPLEMENTED; + } + + switch (vkey) + { + case VK_KANA: + case VK_KANJI: + TRACE("Skipping metakey\n"); + return STATUS_NOT_IMPLEMENTED; + } flags = thread_data->last_modifiers; if (state[VK_SHIFT] & 0x80) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9992
From: Marc-Aurel Zent <mzent@codeweavers.com> --- dlls/imm32/ime.c | 4 +--- dlls/win32u/driver.c | 12 ------------ dlls/win32u/imm.c | 4 ---- dlls/winemac.drv/gdi.c | 1 - dlls/winemac.drv/keyboard.c | 8 -------- dlls/winemac.drv/macdrv.h | 1 - include/ntuser.h | 1 - include/wine/gdi_driver.h | 1 - 8 files changed, 1 insertion(+), 31 deletions(-) diff --git a/dlls/imm32/ime.c b/dlls/imm32/ime.c index 4b84424c24d..c4d71856e68 100644 --- a/dlls/imm32/ime.c +++ b/dlls/imm32/ime.c @@ -540,7 +540,6 @@ BOOL WINAPI ImeSetActiveContext( HIMC himc, BOOL flag ) BOOL WINAPI ImeProcessKey( HIMC himc, UINT vkey, LPARAM lparam, BYTE *state ) { - struct ime_driver_call_params params = {.himc = himc, .state = state}; INPUTCONTEXT *ctx; LRESULT ret; @@ -549,8 +548,7 @@ BOOL WINAPI ImeProcessKey( HIMC himc, UINT vkey, LPARAM lparam, BYTE *state ) if (!is_ime_hkl( GetKeyboardLayout( 0 ) )) return FALSE; if (!(ctx = ImmLockIMC( himc ))) return FALSE; - ret = NtUserMessageCall( ctx->hWnd, WINE_IME_PROCESS_KEY, vkey, lparam, ¶ms, - NtUserImeDriverCall, FALSE ); + ret = TRUE; /* TODO: should be ctx->fOpen */ switch (LOWORD(vkey)) { case VK_SHIFT: diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 40ccdefc6e0..4d9708f377c 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -670,11 +670,6 @@ static void nulldrv_ReleaseKbdTables( const KBDTABLES *tables ) { } -static UINT nulldrv_ImeProcessKey( HIMC himc, UINT wparam, UINT lparam, const BYTE *state ) -{ - return 1; -} - static UINT nulldrv_ImeToAsciiEx( UINT vkey, UINT vsc, const BYTE *state, HIMC himc ) { return STATUS_NOT_IMPLEMENTED; @@ -1102,11 +1097,6 @@ static void loaderdrv_ReleaseKbdTables( const KBDTABLES *tables ) return load_driver()->pReleaseKbdTables( tables ); } -static UINT loaderdrv_ImeProcessKey( HIMC himc, UINT wparam, UINT lparam, const BYTE *state ) -{ - return load_driver()->pImeProcessKey( himc, wparam, lparam, state ); -} - static UINT loaderdrv_ImeToAsciiEx( UINT vkey, UINT vsc,const BYTE *state, HIMC himc ) { return load_driver()->pImeToAsciiEx( vkey, vsc, state, himc ); @@ -1264,7 +1254,6 @@ static const struct user_driver_funcs lazy_load_driver = loaderdrv_VkKeyScanEx, loaderdrv_KbdLayerDescriptor, loaderdrv_ReleaseKbdTables, - loaderdrv_ImeProcessKey, loaderdrv_ImeToAsciiEx, loaderdrv_NotifyIMEStatus, loaderdrv_SetIMECompositionRect, @@ -1369,7 +1358,6 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version SET_USER_FUNC(VkKeyScanEx); SET_USER_FUNC(KbdLayerDescriptor); SET_USER_FUNC(ReleaseKbdTables); - SET_USER_FUNC(ImeProcessKey); SET_USER_FUNC(ImeToAsciiEx); SET_USER_FUNC(NotifyIMEStatus); SET_USER_FUNC(SetIMECompositionRect); diff --git a/dlls/win32u/imm.c b/dlls/win32u/imm.c index 68e19bc7a68..1c1cad94b3f 100644 --- a/dlls/win32u/imm.c +++ b/dlls/win32u/imm.c @@ -663,10 +663,6 @@ LRESULT ime_driver_call( HWND hwnd, enum wine_ime_call call, WPARAM wparam, LPAR switch (call) { - case WINE_IME_PROCESS_KEY: - res = user_driver->pImeProcessKey( params->himc, wparam, lparam, params->state ); - TRACE( "ImeProcessKey vkey %#x, scan %#x -> %lu\n", LOWORD(wparam), HIWORD(lparam), res ); - return res; case WINE_IME_TO_ASCII_EX: if (params->state) { diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c index 1bf703459f5..a0f314234b9 100644 --- a/dlls/winemac.drv/gdi.c +++ b/dlls/winemac.drv/gdi.c @@ -277,7 +277,6 @@ static const struct user_driver_funcs macdrv_funcs = .pUpdateClipboard = macdrv_UpdateClipboard, .pUpdateLayeredWindow = macdrv_UpdateLayeredWindow, .pVkKeyScanEx = macdrv_VkKeyScanEx, - .pImeProcessKey = macdrv_ImeProcessKey, .pImeToAsciiEx = macdrv_ImeToAsciiEx, .pNotifyIMEStatus = macdrv_NotifyIMEStatus, .pSetIMECompositionRect = macdrv_SetIMECompositionRect, diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c index dc064ad4823..8cf203c9fb8 100644 --- a/dlls/winemac.drv/keyboard.c +++ b/dlls/winemac.drv/keyboard.c @@ -1105,14 +1105,6 @@ void macdrv_hotkey_press(const macdrv_event *event) } -/*********************************************************************** - * ImeProcessKey (MACDRV.@) - */ -UINT macdrv_ImeProcessKey(HIMC himc, UINT wparam, UINT lparam, const BYTE *key_state) -{ - return 1; -} - /*********************************************************************** * ImeToAsciiEx (MACDRV.@) */ diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index e5c922296bf..8c8100f38a5 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -158,7 +158,6 @@ extern void macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, HWND owner_hin extern BOOL macdrv_RegisterHotKey(HWND hwnd, UINT mod_flags, UINT vkey); extern void macdrv_UnregisterHotKey(HWND hwnd, UINT modifiers, UINT vkey); extern SHORT macdrv_VkKeyScanEx(WCHAR wChar, HKL hkl); -extern UINT macdrv_ImeProcessKey(HIMC himc, UINT wparam, UINT lparam, const BYTE *state); extern UINT macdrv_ImeToAsciiEx(UINT vkey, UINT vsc, const BYTE *state, HIMC himc); extern UINT macdrv_MapVirtualKeyEx(UINT wCode, UINT wMapType, HKL hkl); extern INT macdrv_ToUnicodeEx(UINT virtKey, UINT scanCode, const BYTE *lpKeyState, diff --git a/include/ntuser.h b/include/ntuser.h index 939771c9121..f8d5882abf4 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -676,7 +676,6 @@ enum wine_internal_message /* builtin IME driver calls */ enum wine_ime_call { - WINE_IME_PROCESS_KEY, WINE_IME_TO_ASCII_EX, WINE_IME_POST_UPDATE, /* for the user drivers */ }; diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index c5b200fb935..97c646d6ec9 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -372,7 +372,6 @@ struct user_driver_funcs const KBDTABLES *(*pKbdLayerDescriptor)(HKL); void (*pReleaseKbdTables)(const KBDTABLES *); /* IME functions */ - UINT (*pImeProcessKey)(HIMC,UINT,UINT,const BYTE*); UINT (*pImeToAsciiEx)(UINT,UINT,const BYTE*,HIMC); void (*pNotifyIMEStatus)(HWND,UINT); BOOL (*pSetIMECompositionRect)(HWND,RECT); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9992
On Tue Apr 14 16:16:12 2026 +0000, Rémi Bernon wrote:
```suggestion:-9+0 if (status == STATUS_NOT_IMPLEMENTED) { TRANSMSG msg = {.message = vsc & KF_UP ? WM_KEYUP : WM_KEYDOWN, .wParam = vkey, .lParam = vsc}; msgs->TransMsg[count++] = msg; } else if (status) WARN( "WINE_IME_TO_ASCII_EX returned unexpected status %#lx\n", status ); else ```
Thanks, that is indeed simpler. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9992#note_136112
On Tue Apr 14 16:10:58 2026 +0000, Rémi Bernon wrote:
My rationale is that the less driver-specific behavior we have, the better it is. We don't *need* to match native exactly, but if matching native allows us to move driver-specific code to the common code, it's an improvement. I will admit this is the dim dark history of work. But my general memory was just what @mzent is saying. I recall the mac IME consuming and doing unexpected things with some vkey values that resulted in text input behaving incorrectly. If we can remove driver specific things that is great! But we will have to carefully test.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9992#note_136113
This merge request was approved by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9992
participants (4)
-
Aric Stewart (@aricstewart) -
Marc-Aurel Zent -
Marc-Aurel Zent (@mzent) -
Rémi Bernon (@rbernon)