Right Alt key also triggers Windows Message for Left Control key - winapi

In a win32 message handler I'd like to be able to handle Left and Right Alt and Control keys. Left and Right is distinguished with bit 24 of lParam, but when I press the Right Alt then I also get a message for Left Control key (Right Alt is therefore "alt gr"). Is there a way to switch off this behavior or somehow distinguish the message for the Left Control key that was triggered by the Right Alt key?

I just hit this issue and found that Keyboard Language had United States-International keyboard selected. Switching that fixed the issue.
I figured it out thanks to Dell - Right Alt click does not work

Read about reading the keyboard states using Msdn GetKeyState
Then call GetKeyState() and use the VK of VK_LSHIFT VK_RSHIFT VK_LCONTROL VK_RCONTROL VK_LMENU VK_RMENU to see if it is pressed or not.

Related

What keyboard shortcut is the arrow down?

What's the shortcut for the little downward arrow in the picture? Since the above shortcut in the printscreen seem to be the "normal" arrow press down, I'm struggling to find what the other arrow is.
Print screen is taken from JetBrains Rider.
That’s the "Page Down" key. (Or Fn + Down, if you haven’t got one.)

VS 2017 (Left Arrow) was pressed. Waiting for second key of chord

In Visual Studio, when I position my cursor to the right of the semi-colon of the following C#:
var alpha;
When I press the left cursor key, nothing happens (call me old-fashioned but I want the cursor to move to the left). Instead, I notice VS shows in the status bar
(Left Arrow) was pressed. Waiting for second key of chord...
How can I setup VS so that Left Arrow is not the start of a chord in the editor?
I can go to Keyboard options but how do I find chords that start with Left Arrow?
I couldn't find a way to do this with VS. However, I found Resharper's Shorts Live View feature (press the left Ctrl key three times in text editor) which displays current shortcuts to be valuable in reporting what actual shortcut had been assigned an are currently active.
It seems I must have pressed Left arrow when assigning a keyboard, so with this tool I could see the name of the command assigned and remove it from Tool | Options.

Issue switching language input

On windows 7 new install I couldn't change language via right alt +
shift.
I could do by the left alt + shift.
I used to change by right alt shift and left alt shift all worked in the previous win7 installation.
Is there anyway to solve this?
Is the keyboard layout set correctly and is the right Alt in fact an Alt-Gr instead of a plain Alt key?
If you right-click your taskbar I think there may be an option to open your Keyboard and Language options. If I'm not remembering correctly then you can certainly get to it through your Control Panel. You can change the keyboard layout here.
Open a text editor and try typing in the alternate and lesser used keys such as #$/|~` and so on to test if the right keys produce the right characters.
The on screen keyboard can also give you a display of what layout the computer thinks you are using. You can find that in your Accessibility Options.

FocusIn/FocusOut not generated

Can someone please clarify the default focus handling of the X11 server? My understanding is that the focus 'follows the mouse' and sure enough if I move the mouse between separate terminals I can see the cursor changing as each window aquires/loses the focus.
But when I run two xev windows and move the pointer between them, I see plenty of MotionNotify/EnterNotify/LeaveNotify as the pointer moves from one window to another - but FocusIn and FocusOut are nowhere to be seen. Is this an oddity in xev? Is there some special mask or property which needs to be applied in order for these events to be generated?
Many thanks, R.
While I do not fully understand the answer(s), I am grateful to parkydr, minitech and any others who may have stopped by.
Thanks again, R.
Having focus refers to the window which receives keyboard input when you press a key.
The focus handling depends on your window manager. The most common mode is click to focus, which your window manager is set to, where you only get focus when you click on the window. An alternative is that the keyboard focus follows the mouse, which is what you are expecting.
There should be a setting to change this in your window manager settings.
The cursor changing does not indicate focus, just that the terminal has defined a different cursor.
To demonstrate, open a terminal and an xev window.
Click on the xev window and press a key, you will see key events.
Move the mouse to the terminal window, you'll see the motion and leave events
Press a key and you'll still see key events from xev
Click on the terminal window, xev will give a focus out event
Press a key, the characters will be displayed in the terminal window
Move the mouse over the xev window and press a key, the character will still come out in the terminal window

"Right Click" keyboard short cut for Visual Studio?

I'm trying to force myself to use as little mouse as possible and I can't find the answer to this simple short-cut anywhere! Here the the steps:
Open up Visual Studio. Open any C# file (or any code file I believe)
Point your mouse anywhere on the
window/file.
Right Click
Is there a shortcut key for this so I don't have to move my hand to the mouse?
Taken from lytebyte, you've got two options:
Shift + F10
That nutty key on the bottom-right of a modern Windows keyboard, the Menu key
Depends on where/why you're right-clicking.
The context-menu key is on the right of the keyboard nowadays, usually between the Windows key and the Control key on the right of your spacebar. That will open the context menu wherever the current focus is (usually in the text editor).
If you're using the right mouse button just to open the refactoring tools, you can use Ctrl + . (control period) to pop open the "smart tag" on any identifier. That'll get you the "generate method stub" menu item and the like.
To open a new file without keyboard you can use
CTRL + SHIFT + N (Using Resharper)
To show up the right click menu for any part of your code. Point to the part that you want and use
SHIFT + F10
Normally, I like using
CTRL + SHIFT + G (Resharper again)
for getting the Navigation menu (Usage, Base, Implementation, etc)
Even better if you want to go to any Method/class/intenal/or a field, use CTRL + SHIFT + ALT + N (Again using Resharper), this will bring you a list of all that match your criteria to choose from.
Does your keyboard have the extra 'Windows' keys, ie. the Windows logo (Start key) and the one on the right-hand side of the spacebar that looks like a menu? Cause that button on the right-hand side is the 'Context menu key'.
See the key between the right-hand side 'Windows' key and the Ctrl key?
Windows Keyboard layout
If your keyboard is less than 10 years old you should have these keys, unless you have an IBM laptop or a Mac.!
Assuming you just want a key you can press to right click, most\many keyboards have a key between alt and ctrl that right clicks.

Resources