Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osx keyboard layout detection #1444

Closed
totaam opened this issue Feb 16, 2017 · 7 comments
Closed

osx keyboard layout detection #1444

totaam opened this issue Feb 16, 2017 · 7 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Feb 16, 2017

Issue migrated from trac ticket # 1444

component: platforms | priority: major | resolution: worksforme | keywords: osx keyboard

2017-02-16 17:20:33: antoine created the issue


The OSX client doesn't do any keyboard layout detection. Let's fix that.

r15090 + r15091 adds the Keyboard_info helper for osx and r15092 tries to detect the keyboard layout used by the client.

Somewhat related to #1171 (OSX server keyboard layout support).

@totaam
Copy link
Collaborator Author

totaam commented Feb 16, 2017

2017-02-16 17:45:27: antoine changed owner from antoine to afarr

@totaam
Copy link
Collaborator Author

totaam commented Feb 16, 2017

2017-02-16 17:45:27: antoine commented


@afarr: do you have any non-US keyboard users? Does this help? Does the "Keyboard_info" tool show sensible values for those cases?

@totaam
Copy link
Collaborator Author

totaam commented Mar 1, 2017

2017-03-01 00:49:11: afarr commented


  • Checking the Keyboard_info tool (2.0 r15170) with a Keyboard that is supposedly an England layout (j k l ; ' \ | ... huh, the last two characters should've been '#' and '~' according to the keyboard key decals... but it looks like this local browser is interpreting them the same as the server-side one did... so that would be OSX blowing it).

Got the same results with a supposedly Korean keyboard.

Will do some more research to figure out where I'm going wrong and comment again. In the meantime, I suppose I shouldn't be surprised that the keyboard info tool is outputting the following.

Schadenfreude:Helpers Schadenfreude$ ./Keyboard_info 

-* (process:1829): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'

-* (process:1829): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'

-* (process:1829): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
2017-02-28 16:48:23.329 Keyboard info[1829:35808] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead. 
Modifiers:

Server Managed                    : None
Missing from pointer events       : lock, control

Layout:     'us'
Layouts:    'us', 'us'
Variant:    ''
Variants:   

Repeat:     None

@totaam
Copy link
Collaborator Author

totaam commented Jul 14, 2017

2017-07-14 18:43:04: antoine commented


Interesting, I changed my preferences to a US keyboard, even showed the little keyboard indicator widget in the menu bar with the US flag, but the tool still showed a British layout...
Googled again and found this better answer: win32api.LoadKeyboardLayout; any solutions for OSX? which uses NSTextInputContext.
This code actually works and replaces the older version in r16345. (this will be backported)

Since the full list of possible "input sources" identifiers is not specified by Apple, it's quite likely that some will be missing, but at least the most common ones are defined and should be detected. (tested with US, British, French and Thai)

@totaam
Copy link
Collaborator Author

totaam commented Jul 25, 2017

2017-07-25 18:07:49: antoine changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Jul 25, 2017

2017-07-25 18:07:49: antoine set resolution to worksforme

@totaam totaam closed this as completed Jul 25, 2017
@totaam
Copy link
Collaborator Author

totaam commented Dec 6, 2017

2017-12-06 10:51:48: antoine commented


See also: #1578, #1665.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant