keyboard-layout

can't get current keyboard layout

筅森魡賤 提交于 2019-12-01 17:27:47
I have tried GetKeyboardLayoutName() and GetKeyboardLayout() for getting the current keyboard layout, but they both give me the default layout and changing the layout doesn't affect the output! while(1) { Sleep(5); for(int i = 8; i < 191; i++) { if(GetAsyncKeyState(i)&1 ==1) { TCHAR szKeyboard[KL_NAMELENGTH]; GetKeyboardLayoutName(szKeyboard); if(GetAsyncKeyState(i)&1 ==1) { TCHAR szKeyboard[KL_NAMELENGTH]; GetKeyboardLayoutName(szKeyboard); cout << szKeyboard << endl ; } } } } It always gives me "00000409" when the default layout is set to English, while I expect it to be "00000429" when I

Can I change a user's keyboard input?

纵然是瞬间 提交于 2019-11-30 19:10:34
I found this keyboard hook code, which I'm trying to slightly modify for my purposes: http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx As an overview, I want to have the user press a key, say 'E', and have the keyboard return a different character, 'Z', to whatever app is in focus. The relevant method I changed now looks like: private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) { //The truely typed character: int vkCode = Marshal.ReadInt32(lParam); Console.WriteLine((Keys)vkCode); KBDLLHOOKSTRUCT replacementKey

Can I change a user's keyboard input?

血红的双手。 提交于 2019-11-30 03:31:09
问题 I found this keyboard hook code, which I'm trying to slightly modify for my purposes: http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx As an overview, I want to have the user press a key, say 'E', and have the keyboard return a different character, 'Z', to whatever app is in focus. The relevant method I changed now looks like: private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) { //The truely typed character:

Find out when keyboard layout is changed

情到浓时终转凉″ 提交于 2019-11-30 02:38:02
问题 I am writing an onscreen keyboard and would like to redraw my layout as soon as keyboard layout is changed. Currently I call: GetKeyboardLayout(GetWindowThreadProcessId(GetForegroundWindow(), NULL)); on every key press to find out if the layout has changed. It does not work if user changes the layout by mouse, until key is pressed. I would like to know if there is any way to get notified when the keyboard layout of the current foreground window is changed, so I can redraw my layout as soon as

Unable to type braces and square braces in emacs

放肆的年华 提交于 2019-11-29 20:26:47
I'm running Mac OS X and GNU Emacs 22.3.1. I use a swedish keyboard. I am unable to type braces { } , [ ] in emacs. When trying to type braces I get parenthesis. Since I'm quite new to Mac and emacs I need a little help on configuring emacs to get this right. (setq mac-option-modifier nil mac-command-modifier 'meta x-select-enable-clipboard t) This is what I use for my swedish keyboard. It even works with svorak A5, if you use it :) You could also try: (setq mac-option-key-is-meta t) (setq mac-right-option-modifier nil) I'm assuming that you're using a graphical emacs, and not just using the

disable automatic changing of keyboard layout in DbGrids.pas in VCL

送分小仙女□ 提交于 2019-11-29 14:10:16
I use ActivateKeyboardLayout(HKL_NEXT, KLF_ACTIVATE); to load Persian keyboard layout using Delphi XE2, But sometimes I click on TextBox or DbGrid control the keyboard automatically is changed to English layout. How can I disable automatic changing of keyboard layout? We have same issues. This bug appeared after upgrade from D2006 to D2010. Issue is in DBGrids.pas: procedure TCustomDBGrid.WMKillFocus(var Message: TMessage); begin ImeName := Screen.DefaultIme; ImeMode := imDontCare; inherited; if not ((InplaceEditor <> nil) and (HWND(Message.WParam) = InplaceEditor.Handle)) then

Qt Embedded for Linux. Keyboard layout switching

自闭症网瘾萝莉.ら 提交于 2019-11-29 11:28:30
I'm developing application with Qt Embedded and run it in linux framebuffer. I need a way to type non-US characters. Is it possible to change keyboard layout with Qt? I tried to run it on Qt/X11. Layout switching and input are perfectly fine there. But when I compile it with Qt/Embedded and run it in framebuffer I cannot change layout. I searched in the documentation and didn't find anything about layout switching. I think it has something to do with qt keyboard driver as specified at the documentation . It seems that I should develop my own keyboard driver. But I'm using standard keyboard and

How to change Keyboard Layout (a X11 API solution)

无人久伴 提交于 2019-11-29 05:14:46
I want to change keyboard layout in Linux by programming, What X11's API function does this? S. Razi I found one good solution. It's a c++ class wrriten by Jay Bromley, that I can add to my app and using it. source code It's very easy to use: #include "XKeyboard.h" XKeyboard xkb; std::string cGrpName=xkb.currentGroupName(); //return somethings like "USA" std::string cGrpSymb=xkb.currentGroupSymbol(); //return somethings like "us" xkb.setGroupByNum(0);//set keyboard layout to first layout in available ones you can read source code and found some another useful functions. for compiling

Unable to type braces and square braces in emacs

荒凉一梦 提交于 2019-11-28 16:38:32
问题 I'm running Mac OS X and GNU Emacs 22.3.1. I use a swedish keyboard. I am unable to type braces { } , [ ] in emacs. When trying to type braces I get parenthesis. Since I'm quite new to Mac and emacs I need a little help on configuring emacs to get this right. 回答1: (setq mac-option-modifier nil mac-command-modifier 'meta x-select-enable-clipboard t) This is what I use for my swedish keyboard. It even works with svorak A5, if you use it :) 回答2: You could also try: (setq mac-option-key-is-meta t

An Ideal Keyboard Layout for Programming [closed]

匆匆过客 提交于 2019-11-28 13:39:52
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I often hear complaints that programming languages that make heavy use of symbols for brevity, most notably C and C++ (I'm not going to touch APL), are difficult to type because they require frequent use of the shift key. A year or two ago, I got tired of it myself,