Keyboard MSI Gaming Keyboard DS4100
This key has replaced left win key between alt and ctrl on the left and I need to remap it if clicked it toggles the right win key, but I cannot identify this key neither with ahk nor other programs like SharpKeys, none of them react when clicking this Fn key, ahk does not record any logs when pressed.
Tried this Identify Special key keycode but it does not record it in the log.
#SingleInstance Force
#InstallKeybdHook
#InstallMouseHook
NP:="Untitled - Notepad"
IfWinExist, % NP
WinActivate
else
IfWinNotExist, % NP
Run, Notepad.exe,, UseErrorLevel, nPID
nPID=%nPID%
if (ErrorLevel){
MsgBox, there is a problem
}else{
ToolTip, Notepad running as PID: %nPID%
Sleep, 1000
ToolTip
}
WinActivate, % NP
WinWaitActive, % NP
Send, {Raw}Hello %A_UserName%,`n`nRight click on the H icon on your traybar`ngoto -> "Open" -> "View" - > "Key History and Script Info"`n`nThis area shows you your past keypresses. =]`n`n-islanq
return
Also tried SharpKeys, autodetect does not detect, tried setting manually where I found one key saying Wake (or Fn), but no effect.
Same with KeyTweak.
(zoom in)
Did you try to find its virtual key and scan code (vkXXscYYY) by looking into key history?
This post might help you out, depending on how the Fn key is implemented.
Related
I have been trying to play Omikron: The Nomad Soul, but I found it incredibly difficult to do so without using the mouse. I have been trying to use dinput.dll to simulate keyboard presses using mouse movement, but nothing I tried so far worked. I am a complete amateur at this, so I thought I should ask how to do this properly.
What I am trying to do is to edit dinput.dll source code from github, create a dinput.dll file with configurable ini file, where you can assign key presses to mouse movement. This would be beneficial in many old games.
For example;
Mouse moving up = press up arrow key
Mouse moving down = press down arrow key
Mouse moving left = press left arrow key
Mouse moving right = press right arrow key
Reason why I want to use dinput instead of something like autohotkey is because stuff like autohotkey doesn't always get along well with old games. For example Omikron: The Nomad Soul.
Thank you for any help in advance.
My platform is Linux, and there is a shortcut Alt + Left Shift + Num Lock to enable mouse keys TEMPORARILY. They say this feature is provided by X server, so it can be used on all desktop environments based on X. The problem is that the effect doesn't last long. The keypad will switch back to normal keypad automatically, and cannot be used to emulate a mouse. Therefore, whenever I want to move the cursor, the result may become scrolling to the bottom of the current document, which is annoying. Is there any way to prevent X from switching the keypad back to its original keypad function automatically? Thanks.
I am running ML model, which predicts fingure gestures.I am trying to simulate key press event in python using pynput library and I check it's working fine.But I have other program which Is a game written in python using pygame library , which opens up in a new window , but the problem is key press controls doesn't work on that, but it works when I manually press keyboard buttons.
In pygame you can add events to the event queue by doing:
newevent = pygame.event.Event(type, **attributes) #create the event
pygame.event.post(newevent) #add the event to the queue
Where type is the type of the event (a numerical constant) and **attributes a keyarg list of attributes, also predefined constants.
All these constants are defined in the pygame.locals module. pygame event docs and pygame key docs list all of them.
So if you want to simulate the press of the 'a' key for example, the code would be:
newevent = pygame.event.Event(pygame.locals.KEYDOWN, unicode="a", key=pygame.locals.K_a, mod=pygame.locals.KMOD_NONE) #create the event
pygame.event.post(newevent) #add the event to the queue
KEYDOWN is the constant corresponding to the keydown event.
unicode is the unicode representation of the pressed key.
key is a constant associated to the pressed key.
mod is a constant representing a modifier (if the button is pressed while also SHIFT or CAPS_LOCK is pressed, for example).
Hope it helps.
I solved the problem by emulating key press event using keyboard.press and listen the same event using keyboard.Listner() both are present in keyboard library.So I didn't use pygame functions to listen the event. Thanx everyone for ur help.
I want my script to listen to the string I will enter after the PrintScreen button is pressed. For example, if I press the PrintScreen button and type "paint" afterwards, it should open MSPaint. If I however type "photoshop", it should open Photoshop.. Is this possible?
Here is my attempt, a completely failure (I'm new to AHK by the way..)
~PrintScreen::paint::
Run, MSPaint
WinWaitActive, Untitled - Paint
Send, ^v
return
~PrintScreen::photoshop::
Run, Photoshop
WinWaitActive, Adobe Photoshop CS6
Send, ^v
return
well you are right, printScreen::paint:: is no valid AutoHotkey code.
Make use of Ahk's Input command instead - it was made to listen for strings / characters:
~PrintScreen::
input, outputString, i, {enter}.{esc}{tab}
if outputstring = paint
{
Run, MSPaint
WinWaitActive, Untitled - Paint
Send, ^v
} else if outputstring = photoshop
{
Run, Photoshop
WinWaitActive, Adobe Photoshop CS6
Send, ^v
}
return
I however encourage you to have a look at input's options yourself to adjust it to your needs. Good luck
I want to show the hotkeys for label, button on screen without pressing Alt Key. For example
Alt + N opens new dialog where N is hot key so I want underline always appears below N.
I am not sure how we can achieve this without Pressing alt key. After pressing Alt Key hot key is shown but we want to show the corresponding hot key all the time till the screen is open.
I answered in this nearly identical question that
If you have any control over the operating system on which the program is being deployed, apparently you can force the underlined shortcut letter to always be displayed by going to Control Panel -> Display -> Appearance -> Effects -> Hide underlined letters for keyboard navigation.
If you can't do that, some of the other answers mentioned using a System.Windows.Forms.SendKeys class.