Le 30 oct. 2010 à 09:34, Richmond a écrit :
> Ugh; Apple, not content with hiding the # key from people on the East side of
> the Atlantic
> have also been playing "silly buggers" with the physical layout of keyboards:
>
> For instance:
>
> My non-American (this includes my English & Arabic Mac keyboard) keyboards
> have a
> siglum key in the top-left corner = rawKeyDown 0, and American keyboards have
> a
> "funny apostrophe" key in the same place = rawKeyDown 96. rawKeyDown 96 on
> the non-American keyboards is snuggled down left of the Z key.
>
> For virtual keyboard people (like myself) working with LiveCode this is
> a right pox as, frankly, the thought of trying to set up some sort of keyboard
> detection routine followed by a "dance of the vampires" sort of arrangement
> whereby various buttons would merrily shift their position depending on the
> keyboard
> layout gives me the willies . . .
>
> Err . . . anybody know a way, within LiveCode/RunRev to detect an end-user's
> physical keyboard?????
THAT's a really good question ! Not sure my answer is the best one:
if you
put URL "file:/library/preferences/com.apple.HIToolbox.plist" into tKeyboard
the variable tKeyboard will contain something like:
bplist00fl
"#$%&+-./_AppleNumberResID_AppleItlbNumber_ApplePreviousInputSource]AppleItlbKeys]Keyboard
Menu_AppleSelectedInputSources^AppleDateResID_AppleCurrentAsciiInputSource_'AppleCurrentKeyboardLayoutInputSourceID]AppleItlbDate_AppleEnabledInputSources_AppleInputSourceHistory_AppleKeyboardScript_AppleCurrentInputSource_AppleDefaultAsciiInputSource^AppleTimeResID—WsmRoman—?ˇ”_InputSourceKind_KeyboardLayout
Name_KeyboardLayout ID_Keyboard Layout\Swiss French——Vkcfg
0Ot W fl W ‡ G P
I \ ?¨ ?≠ ?Ø ?Æ °!”—”_com.apple.keylayout.SwissFrench—¢'*”()VFrench”°,”””— + >