QUESTION :
I have Logitech wireless keyboard and mouse MK710. On Fedora I could map every key including a custom key that opens a CD tray, in fact I think all keys were mapped correctly by default. On Windows 10, that’s not the case. I’ve downloaded every windows program/driver related to my keyboard, available on Logitech’s website.
I’ve seen couple of keyboard mapping programs for windows, they say that they don’t map custom Logitech keys and such, they only map keys that are supported by default in windows.
I’ve contacted Logitech, they told me to use their software called Setpoint, I tried but it only detects the calculator key. I replied telling them them that their software didn’t work, they ignored my second email.
Is it possible to map these custom keys? Currently the keys I want to map do nothing at all.
ANSWER :
Setpoint is very bad on custom keys, and in addition it has the bad habit
of swallowing up some of these keys, such as the multimedia keys,
so they are unavailable to other programs.
I suggest to avoid Setpoint and to use instead
AutoHotkey.
Your first step is to find out the scan-codes of the special keys.
Since we are using AutoHotkey, create a .ahk
file, and enter and run the
following scriptlet
(source):
SetFormat, Integer, Hex
Gui +ToolWindow -SysMenu +AlwaysOnTop
Gui, Font, s14 Bold, Arial
Gui, Add, Text, w100 h33 vSC 0x201 +Border, {SC000}
Gui, Show,, % "// ScanCode //////////"
Loop 9
OnMessage( 255+A_Index, "ScanCode" ) ; 0x100 to 0x108
Return
ScanCode( wParam, lParam ) {
Clipboard := "SC" SubStr((((lParam>>16) & 0xFF)+0xF000),-2)
GuiControl,, SC, %Clipboard%
}
Run it and when the GUI is in focus press a key and the scancode
will be displayed and copied to the clipboard in the format for using
as hotkey or with Send commands.
The scancodes can be used in a scriptlet.
For example, use the Browser multimedia key to run Firefox:
SC032::Run "C:Program Files (x86)Mozilla Firefoxfirefox.exe"
Once the scriptlet is complete, you may store it in the Startup
folder so it will run automatically with Windows.
You may need to search for command-line programs that can do the operations
you need. For example, sound can be controlled by the free
NirCmd.
As per others, changing the user.xml file that is written to
%USERPROFILE%AppDataRoamingLogitechSetPoint
is the only way I could get it to work properly.
For example, for a Logitech K530 keyboard, I wanted to map the Gadgets key (top left) and the Media Center key (top right) to move applications to the monitor on the left/right.
I used the SwitchMonitorLeft and SwitchMonitorRight HandlerSets – other examples can be found in C:Program FilesLogitechSetPointPdefault.xml file.
This is what worked for the Gadgets key:
<Button Number="589885" Name="Gadgets">
<Param IconLoc="DevicesKeyboardCommonIconsGadgets" Type="HOTKEY"/>
<Trigger Class="ButtonPress">
<Param Button="589885" EventType="100663297" FirstRepeatDelay="0" RepeatDelay="0" Silent="0" Type="0"/>
<TriggerState Name="ButtonDownUp" HandlerSet="SwitchMonitorLeft">
</TriggerState>
</Trigger>
</Button>
and this for the Media Center key:
<Button Number="12320781" Name="Media Player">
<Param IconLoc="DevicesKeyboardCommonIconsmediacenternew" Type="HOTKEY"/>
<Trigger Class="ButtonPress">
<Param Button="12320781" EventType="100663297" FirstRepeatDelay="0" RepeatDelay="0" Silent="0" Type="0"/>
<TriggerState Name="ButtonDownUp" HandlerSet="SwitchMonitorRight">
</TriggerState>
</Trigger>
</Button>