keyboard-layout

Get Physical Keyboard Layout Programmatically

╄→гoц情女王★ 提交于 2019-12-11 02:37:33
问题 Is there a way to programmatically find out what kind of keyboard a computer has (i.e. where keys are located, and what extra keys are present in which locations)? A little error is acceptable, if the keyboard is very non-standard, but in general, the point is to construct an on-screen keyboard-like application that can dynamically draw the keyboard layout on the screen, with high accuracy. 回答1: There is no mechanism by which a keyboard can tell Windows what its physical layout looks like.

Override inet using xkb under Linux

依然范特西╮ 提交于 2019-12-11 02:35:54
问题 I'm on Arch Linux (everything's up to date). I know how to define a new keyboard layout based on those under /usr/share/X11/xkb/symbols: I successfully created (and used) one from scratch but there's one little thing I still can't do... overriding keys from /usr/share/X11/xkb/symbols/inet. In particular, I'd like to disable I232 and I233 (brightness keys) without modifying /usr/share/X11/xkb/symbols/inet itself. Are those keys "protected" in a way they can't be overridden in a keyboard layout

How to obtain keyboard layout for Microsoft Edge and other windows hosted in ApplicationFrameHost.exe

女生的网名这么多〃 提交于 2019-12-11 02:04:31
问题 As we all know, Windows's keyboard layouts are thread-specific. When a layout changes, a message is dispatched to the foreground thread by the shell. So if one wants to obtain the most recent system-wide keyboard layout, one must do something like this: const HWND foregroundWindow = ::GetForegroundWindow(); const DWORD foregroundThread = ::GetWindowThreadProcessId(foregroundWindow, NULL); const HKL layout = ::GetKeyboardLayout(foregroundThread); This works fine for most native Windows apps.

change the keyboard layout after a button click

微笑、不失礼 提交于 2019-12-10 16:45:54
问题 I'm developping an android app , and i have an EditText and a two RadioButtons ( A and B ), what i'm trying to do is : When RadioButton A is checked , i want to change the keyboard layout to display it with the Done button , When the RadioButton B is checked, i want to change the keyboard layout to display it with the Search Button . I've tried to change the IMEOptions of my EditText like this , but it still doesn't work : NB : the keyboard is already visible, what i want to do is just modify

How to get the code page of the current keyboard layout?

ぃ、小莉子 提交于 2019-12-10 10:54:47
问题 My non-Unicode application needs to be able to process Unicode keyboard input (WM_CHAR/etc.), thus receive the 8-bit character code then internally convert it to Unicode. 9x-compatibility is required, so using most Unicode APIs is not an option. Currently it looks at the language returned by PRIMARYLANGID(GetKeyboardLayout(0)), and looks up the relevant code page in a hard-coded table. I couldn't find a function to get the code page used by a particular language or keyboard layout. Converting

Preserving keyboard layout in a JTextfield?

跟風遠走 提交于 2019-12-09 07:03:00
问题 Simple example: 2 JTextFields , one for a spanish word another one for it's translation. Is there a way to preserve keyboard layout per JTextField so that the user wouldn't have to switch back and forth? TIA. 回答1: Yes, this demo code uses the keyboard layout for the selected locales in each text field: public class InputMethodTest { public static void main(String[] args) { final InputContext en = InputContext.getInstance(); en.selectInputMethod(Locale.UK); final InputContext es = InputContext

SendInput() and non-English characters and keyboard layouts

天涯浪子 提交于 2019-12-07 09:23:21
问题 I'm having trouble simulating character keypresses when a non-English input keyboard language is being used in Windows. I tried calling SendInput() with KEYEVENTF_UNICODE: KEYBDINPUT ki; INPUT input; int character = 0; ki.wVk = 0; ki.wScan = character; ki.dwFlags = KEYEVENTF_UNICODE; ki.time = 0; ki.dwExtraInfo = 0; input.type = INPUT_KEYBOARD; input.ki = ki; SendInput(1, &input, sizeof(INPUT)); And this actually works (of course, in my code, I also do a KEYUP after the key down)... except in

Keyboard Layout library to find Neighboring Keys given an input key (java preferable) [closed]

喜你入骨 提交于 2019-12-07 03:49:46
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Does anyone know of a library (preferably java) that can give me neighboring keys given a key input for US_ENGLISH standard keyboard? E.g. if I input the character 'd', I should get the following characters returned: [w,e,r,s,f,x,c,v]. Alternatively a grid manipulation api would work too (so that I can instantiate

How to get the code page of the current keyboard layout?

丶灬走出姿态 提交于 2019-12-06 13:37:55
My non-Unicode application needs to be able to process Unicode keyboard input (WM_CHAR/etc.), thus receive the 8-bit character code then internally convert it to Unicode. 9x-compatibility is required, so using most Unicode APIs is not an option. Currently it looks at the language returned by PRIMARYLANGID(GetKeyboardLayout(0)), and looks up the relevant code page in a hard-coded table. I couldn't find a function to get the code page used by a particular language or keyboard layout. Converting a character/string can then be done with MultiByteToWideChar. Is there a way to get the current