Do I Need to Lube My Keyboard Switches?
Figure 1: Sometime around here is a good time to ask that question... If you’re new to the mechanical keyboard hobby, I have no doubt that planning your first keyboard build is a bit of a daunting task. To be entirely honest with you, it’s only a tiny bit less daunting for your second or even third keyboard builds should you stay around a little while longer. You’ve got the keyboard itself to worry about, stabilizers, keycaps, and even switches on top of all of the intangible marks you want your dream keyboard to hit. Switches are especially daunting right out of the gate as there’s just so many options out there to pick from – each with their own unique specifications, manufacturers, and more. Yet, in spite of all of these differences between switches, time and time again I find people always asking about lubing switches as one of their chief concerns when it comes to picking some up. With countless numbers of content creators talking about lubing switches, its no...
Apr 17, 2024
i don't know by myself, but i've read sometimes that GlovePIE might be able to do what you like. http://glovepie.org/
From the GlovePie wiki: "A very cool feature is that you can now swallow keys. When you swallow keys, other programs will not be able to read them. Only GlovePIE will be able to read them...
...If you have multiple keyboards, you can only swallow the key on all keyboards, not on specific keyboards. If you swallow a key on all keyboards, it is impossible for GlovePIE to tell which keyboard it came from."
http://glovepie.org/w/index.php?title=Preliminary_Documentation_v0.45
GODSPEED
HIDmacros has issues with firefox and chrome where it wont capture key presses if you are actively browsing with them. I am using Win10 but I saw a post in the forums where it is also happening in Win8 developer is using Win7 and doesn't seem to be experiencing it.I decided to try LuaMcaros and got better results, Since LuaMacros is script based I figured I would share everything I have figured out so far.
I uploaded the scripts I have to my dropbox. There are 4 scripts in the zip. My script is set to make the switch tester become F13(del)-F24(9). I don't have anything higher then F12 on my keyboard and I don't use any apps that normally uses those keys so I figured it was safe. switchTester.lua - simple script without any config(open, run, press key on switch tester) switchTester-custom.lua - needs to be configured but once its set no interaction needed Get_Keyboard_ID.lua - used to get the ID of the switch tester AutoHotkey-test-script.ahk - script to test buttons creates dialog boxes as button press confirmation. MyScripts - https://www.dropbox.com/s/30mqwuz6nguxrol/switchTester-scripts.zip?dl=0 LuaMacros - http://www.hidmacros.eu/forum/viewtopic.php?f=10&t=241 AutoHotkey - https://autohotkey.com/download/
Now to the issue(s) I noticed so far LuaMacros uses if elseif statements to see what button is pressed so only one key can be used at a time. I am not sure if this can be changed but thats how I got the script working at the moment. There isn't much documentation on LuaMacros as it is still in beta but scripting is suppose to be similar to HIDmacros. I will have to search to see if HIDmacros has more instructions. One of the reasons I am having AutoHotkey doing the heavy lifting is the amount of documentation that is available.
When gaming normal macros seem to execute just fine. But trying to move your character with the switch tester doesn't seem to work good. Part of it is the issue mention above where only one key can be used at a time but the other issue might be something with autohotkey. I found a topic on it on their forums but I still didn't get the results I wanted when it comes to character movement. I was testing in FFXIV with HIDmacros and LuaMacros https://autohotkey.com/board/topic/111737-how-to-make-ahk-work-in-most-games-the-basics/
If you plug the switch tester to a different port you will have to redo the configuration in LuaMacros as the device ID will most likely change. In HIDmacros to move all the keybinds at once you will need to select the old device ID under Devices then click "Move macros" then select which keyboard to move it to. Under Macros tab you can see what device it is currently looking at next to "Trigger:" and you can see what your switch tester currently is by pressing a key and looking at the Test Area.
-r is the run command test.lua is the file you want it to load.
I currently have a shortcut with the -r removed so at least my script loads into the window.
But I guess my sadness is your happiness, considering I can find my way around C#/C++ moderately. I've honestly never tried remapping keys in any C language, but I'll try some stuff out and report back with my findings in two weeks or so.
EDIT: Just to make it clear; not trying to critizise you or something. I know it's really hard to remap them through existing software (without remapping your main keyboards keys). Really thankful for the scripts you've made; which do work for a lot of stuff
The fastest solution I've found is writing a driver in C++. Now, I can't do this (yet, since writing drivers is a real commitment, and a pain). Luckily, there is a library available that _exactly_ does what we need, called interception, http://www.oblita.com/interception.html. No driver writing here, so it's good to go!
I'll hopefully start upcoming week or so. Do you have any suggestions for remaps (since it will be a bit of a challenge changing them on-the-fly)? I could remap some keys to arrow keys, and some keys to F keys.
And, ofcourse, it'll all be open source. Ill try to make the remapping less painful for people who'd want to change the code and recompile. I'll also include the compiled executables (and put everything on github).
This is not ideal (I understand your point), but I'll keep what you said in mind and make two codebases; one with F keys only, and one with a custom layout.
As for the layout, I'll be going with this for the custom one (30 seconds in paint)
Also, correction on myself: Interception is actually a driver-api like interface. "What’s Interception? A programming interface for intercepting input device communication.".
So you basically will always have to install the interception driver first, which is included in the github repo linked somewhere on the page.
So basically, the driver is already written for you. It also claims to be able to only send keypressed for certain devices, and I've read all about people succesfully doing it. http://www.oblita.com/interception.html
I hope I'll be able to write something up this weekend, if my work-related projects won't interfere.