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
c4761d80
Commit
c4761d80
authored
Nov 20, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Nov 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Actually set the system's keyboard layout.
parent
f6e2af68
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
63 deletions
+29
-63
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+11
-0
keyboard.c
dlls/winemac.drv/keyboard.c
+17
-63
macdrv_cocoa.h
dlls/winemac.drv/macdrv_cocoa.h
+1
-0
No files found.
dlls/winemac.drv/cocoa_app.m
View file @
c4761d80
...
@@ -2503,3 +2503,14 @@ CFArrayRef macdrv_create_input_source_list(void)
...
@@ -2503,3 +2503,14 @@ CFArrayRef macdrv_create_input_source_list(void)
return
ret
;
return
ret
;
}
}
int
macdrv_select_input_source
(
TISInputSourceRef
input_source
)
{
__block
int
ret
=
FALSE
;
OnMainThread
(
^
{
ret
=
(
TISSelectInputSource
(
input_source
)
==
noErr
);
});
return
ret
;
}
dlls/winemac.drv/keyboard.c
View file @
c4761d80
...
@@ -1115,48 +1115,6 @@ void macdrv_hotkey_press(const macdrv_event *event)
...
@@ -1115,48 +1115,6 @@ void macdrv_hotkey_press(const macdrv_event *event)
/***********************************************************************
/***********************************************************************
* get_locale_keyboard_layout
*/
static
HKL
get_locale_keyboard_layout
(
void
)
{
ULONG_PTR
layout
;
LANGID
langid
;
layout
=
GetUserDefaultLCID
();
/*
* Microsoft Office expects this value to be something specific
* for Japanese and Korean Windows with an IME the value is 0xe001
* We should probably check to see if an IME exists and if so then
* set this word properly.
*/
langid
=
PRIMARYLANGID
(
LANGIDFROMLCID
(
layout
));
if
(
langid
==
LANG_CHINESE
||
langid
==
LANG_JAPANESE
||
langid
==
LANG_KOREAN
)
layout
|=
0xe001
<<
16
;
/* IME */
else
layout
|=
layout
<<
16
;
return
(
HKL
)
layout
;
}
/***********************************************************************
* match_keyboard_layout
*/
static
BOOL
match_keyboard_layout
(
HKL
hkl
)
{
const
DWORD
isIME
=
0xE0000000
;
HKL
current_hkl
=
get_locale_keyboard_layout
();
/* if the layout is an IME, only match the low word (LCID) */
if
(((
ULONG_PTR
)
hkl
&
isIME
)
==
isIME
)
return
(
LOWORD
(
hkl
)
==
LOWORD
(
current_hkl
));
else
return
(
hkl
==
current_hkl
);
}
/***********************************************************************
* macdrv_process_text_input
* macdrv_process_text_input
*/
*/
BOOL
macdrv_process_text_input
(
UINT
vkey
,
UINT
scan
,
UINT
repeat
,
const
BYTE
*
key_state
,
void
*
himc
)
BOOL
macdrv_process_text_input
(
UINT
vkey
,
UINT
scan
,
UINT
repeat
,
const
BYTE
*
key_state
,
void
*
himc
)
...
@@ -1210,20 +1168,11 @@ HKL CDECL macdrv_ActivateKeyboardLayout(HKL hkl, UINT flags)
...
@@ -1210,20 +1168,11 @@ HKL CDECL macdrv_ActivateKeyboardLayout(HKL hkl, UINT flags)
{
{
HKL
oldHkl
=
0
;
HKL
oldHkl
=
0
;
struct
macdrv_thread_data
*
thread_data
=
macdrv_init_thread_data
();
struct
macdrv_thread_data
*
thread_data
=
macdrv_init_thread_data
();
struct
layout
*
layout
;
/* FIXME: Use Text Input Services or NSTextInputContext to actually
TRACE
(
"hkl %p flags %04x
\n
"
,
hkl
,
flags
);
change the Mac keyboard input source. */
FIXME
(
"hkl %p flags %04x: semi-stub!
\n
"
,
hkl
,
flags
);
if
(
flags
&
KLF_SETFORPROCESS
)
{
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
FIXME
(
"KLF_SETFORPROCESS not supported
\n
"
);
return
0
;
}
if
(
flags
)
if
(
flags
)
FIXME
(
"flags %x not supported
\n
"
,
flags
);
FIXME
(
"flags %x not supported
\n
"
,
flags
);
if
(
hkl
==
(
HKL
)
HKL_NEXT
||
hkl
==
(
HKL
)
HKL_PREV
)
if
(
hkl
==
(
HKL
)
HKL_NEXT
||
hkl
==
(
HKL
)
HKL_PREV
)
{
{
...
@@ -1232,17 +1181,22 @@ HKL CDECL macdrv_ActivateKeyboardLayout(HKL hkl, UINT flags)
...
@@ -1232,17 +1181,22 @@ HKL CDECL macdrv_ActivateKeyboardLayout(HKL hkl, UINT flags)
return
0
;
return
0
;
}
}
if
(
!
match_keyboard_layout
(
hkl
))
EnterCriticalSection
(
&
layout_list_section
);
update_layout_list
();
LIST_FOR_EACH_ENTRY
(
layout
,
&
layout_list
,
struct
layout
,
entry
)
{
{
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
if
(
layout
->
hkl
==
hkl
)
FIXME
(
"setting keyboard of different locales not supported
\n
"
);
{
return
0
;
if
(
macdrv_select_input_source
(
layout
->
input_source
))
{
oldHkl
=
thread_data
->
active_keyboard_layout
;
thread_data
->
active_keyboard_layout
=
hkl
;
}
break
;
}
}
}
LeaveCriticalSection
(
&
layout_list_section
);
oldHkl
=
thread_data
->
active_keyboard_layout
;
if
(
!
oldHkl
)
oldHkl
=
macdrv_GetKeyboardLayout
(
0
);
thread_data
->
active_keyboard_layout
=
hkl
;
return
oldHkl
;
return
oldHkl
;
}
}
...
...
dlls/winemac.drv/macdrv_cocoa.h
View file @
c4761d80
...
@@ -415,6 +415,7 @@ extern int macdrv_send_text_input_event(int pressed, unsigned int flags, int rep
...
@@ -415,6 +415,7 @@ extern int macdrv_send_text_input_event(int pressed, unsigned int flags, int rep
extern
void
macdrv_get_input_source_info
(
CFDataRef
*
uchr
,
CGEventSourceKeyboardType
*
keyboard_type
,
int
*
is_iso
,
extern
void
macdrv_get_input_source_info
(
CFDataRef
*
uchr
,
CGEventSourceKeyboardType
*
keyboard_type
,
int
*
is_iso
,
TISInputSourceRef
*
input_source
)
DECLSPEC_HIDDEN
;
TISInputSourceRef
*
input_source
)
DECLSPEC_HIDDEN
;
extern
CFArrayRef
macdrv_create_input_source_list
(
void
)
DECLSPEC_HIDDEN
;
extern
CFArrayRef
macdrv_create_input_source_list
(
void
)
DECLSPEC_HIDDEN
;
extern
int
macdrv_select_input_source
(
TISInputSourceRef
input_source
)
DECLSPEC_HIDDEN
;
extern
const
CFStringRef
macdrv_input_source_input_key
DECLSPEC_HIDDEN
;
extern
const
CFStringRef
macdrv_input_source_input_key
DECLSPEC_HIDDEN
;
extern
const
CFStringRef
macdrv_input_source_type_key
DECLSPEC_HIDDEN
;
extern
const
CFStringRef
macdrv_input_source_type_key
DECLSPEC_HIDDEN
;
extern
const
CFStringRef
macdrv_input_source_lang_key
DECLSPEC_HIDDEN
;
extern
const
CFStringRef
macdrv_input_source_lang_key
DECLSPEC_HIDDEN
;
...
...
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