What is the AHK keycode for the auto-rotate button? - windows

I'm attempting to remap a physical button on my laptop that triggers the auto-rotate toggle inside Windows 10. I know the keyboard shortcut for this Windows+O which would be #o in AutoHotKey.
With the following code snippet I can swap the autorotate key and volume down key (just an example).
#o::Volume_Down
Volume_Down::#o
But what is the underlying signal/keycode that Windows+O triggers, and can I trigger it with a keycode instead of with #o?

Turns out there is no keycode for this. It's a key combination: Win+O. The key on the side of the laptop simply sends Win+O.

Related

Keyboard event on windows

I need to test keyboards keys so I created a virtual keyboard and light up keys when they are pressed>
On windows I get an issue, two key never send any signal : the print key & function key (located between the right alt gr and the right ctrl)
Also some key activate various signal when pressed (like turning on or off the sound...)
How can get a signal from these two keys with Qt ?
How can I override windows control over the keyboard during the test so that I will be the only one to receive keyboard input ?

osx fn and select key not responding on external keyboard

I have a MacBook Pro (from 2015) and an external keyboard (DuckyZero 2108).
I have already swapped the modifier keys 'option/alt' and 'command' on the left side of my external keyboard to make it behave like my internal keyboard.
I have tried to map the 'fn' key, which is on the right side of my external keyboard, to 'option/alt' with KeyRemapFor4MacBook (karabiner) with no succes. Againt, to make sure that my external keyboard behaves like my internal keyboard.
It seems that the keys 'fn' and 'select' on my externel keyboard are not detected when pressed by my MacBook (checked this with Keyboard Viewer), thus mapping with KeyRemapFor4MacBook has no effect.
The 'fn' key works on hardware level and the 'select' key is detected by http://www.keyboardtester.com/tester.html (could not test the 'fn' key on keyboard.com due to the absence of the 'fn' key in their layout).
My question is, is it possible to make the 'fn' and/or 'select' key on my external keyboard respond/detect after being pressed, so that I can remap it to 'option/alt'?

Emacs keyboard-shortcut sequences after CapsLock remapping with Authotkey

I've made simple remapping of CapsLock to Control with autohotkey:
Capslock::Control ; make Caps Lock the control button
This works OK, but in Emacs if I need to do a key sequence like Ctrl-x Ctrl-f while holding the CapsLock key continuously the whole time what gets registered is Ctrl-x f. In order to get the correct sequence I now have to release CapsLock between the keystrokes like Ctrl-x <release> Ctrl-f which is very inconvenient.
Is there a way to do the rebinding so that holding CapsLock down will work exactly as holding down the Control button?
I've also tried the following snippet without success:
#IfWinActive ahk_class Emacs
{
CapsLock::
Sendinput {Ctrl Down}
KeyWait, CapsLock
Sendinput {Ctrl Up}
return
}
Using Send or Sendplay in the above instead of Sendinput also doesn't solve my problem.
My system:
Windows 7 32bit
AHK v1.1.13.01
Emacs 24.3
Thank you!
I'm not sure why it's not working correctly for you. I added your remapping into my existing script and it seems to work fine. Can you post more of what you have? I have the following commands at the top of mine but I wouldn't think they should affect your problem.
#Persistent
#SingleInstance, Force
The commands GetKeystate
and SetKeyDelay might be helpful.
This is what I use and it works:
*Capslock::LCtrl
The asterisk is documented in the help under Keyboard Control > Hotkeys and Hotstrings:
Wildcard: Fire the hotkey even if extra modifiers are being held down. This is often used in conjunction with remapping keys or buttons. For example:
*#c::Run Calc.exe ; Win+C, Shift+Win+C, Ctrl+Win+C, etc. will all trigger this hotkey.
*ScrollLock::Run Notepad ; Pressing Scrolllock will trigger this hotkey even when modifer key(s) are down.
This symbol is ignored on Windows 95/98/ME.
I actually have this one too, +Caps Lock, if I really want caps lock:
<#Capslock::Capslock
Try this;
SetCapsLockState, AlwaysOff
CapsLock:: SendInput, {LCtrl Down}
Capslock Up:: SendInput, {LCtrl Up}

Capturing shift key state on Windows 8 tablet in MFC App

Our MFC-based Windows application has functionality that depends on the state of the shift key. Shift exposes power-user menu commands and shift-dragging has different behavior than normal dragging. I am exploring our options in supporting Windows 8 tablets, and it seems that there is no straightforward way to detect the state of the Windows 8 soft keypad shift key.
Using GetAsyncKeyState(VK_SHIFT) (our current method) doesn't detect this key.
Experimenting with examining all incoming keyboard messages, I find:
A single isolated tap of the shift key produces no keyboard event
A double tap of the shift key produces a caps lock key event, indistinguishable from a normal caps lock key event
A single tap of the shift key followed by another keystroke (eg. the 'q' key) produces a shift key event, the keystroke, and a shift key (up?) event.
Are there any other ways I could try to detect the state of the soft keyboard shift key? Has anyone else had success detecting the state of this keypad on Windows 8 tablet soft keyboards.
The external keyboards that you plug into these devices all have normal behaving shift keys. The problem is specific to the soft keypad.

Right Alt key also triggers Windows Message for Left Control key

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.

Resources