MOD - use a MX-Lock as Caps lock switch.
-
- Location: Ålesund, Norway
- DT Pro Member: -
Hi, just finished modding my Pure to use a MX Lock on the Caps lock switch.
I can make a HOW-TO if somebody is interested
I removed the Caps lock LED in the process, as I felt is is unnecessary, but it is possible to keep that.
pictures:
View of the Attiny85, two resistors and a transistor, and some messy wires
also note that I replaced the mini USB connector with a Micro USB connector, always interesting to get fine pitched SMD-parts to mate up with Through hole stuff.
Sweeet switch in place
I can make a HOW-TO if somebody is interested
I removed the Caps lock LED in the process, as I felt is is unnecessary, but it is possible to keep that.
pictures:
View of the Attiny85, two resistors and a transistor, and some messy wires
also note that I replaced the mini USB connector with a Micro USB connector, always interesting to get fine pitched SMD-parts to mate up with Through hole stuff.
Sweeet switch in place
- damorgue
- Location: Sweden
- Main mouse: MX500
- Favorite switch: BS, MX Green and MX Clear
- DT Pro Member: -
- Contact:
Did you use the LED as a feedback to sense when Caps Lock is activated?
That sounds awesome, I believe the firmware I am using for my Phantom has the problem that if you activate Caps Lock without depressing the key so that it locks, then the keyboard and the OS becomes out of sync. Meaning, it will be deactivated when depressed, and activated when released back up. Your way solves that if my theory is correct. Awesome.
That sounds awesome, I believe the firmware I am using for my Phantom has the problem that if you activate Caps Lock without depressing the key so that it locks, then the keyboard and the OS becomes out of sync. Meaning, it will be deactivated when depressed, and activated when released back up. Your way solves that if my theory is correct. Awesome.
-
- Location: Ålesund, Norway
- DT Pro Member: -
I will make a wiki entry later.
Will of course include the code I wrote for the attiny.
Damorgue:
Your theory is correct, so If you have another keyboard connected or use a on-screen keyboard the caps lock on that will be useless, as the chip I installed senses that the led is lit (or just the signal if you remove the led) and it will disable or enable (depending on the position of the MX-lock) the caps lock within 60 milliseconds.
Will of course include the code I wrote for the attiny.
Damorgue:
Your theory is correct, so If you have another keyboard connected or use a on-screen keyboard the caps lock on that will be useless, as the chip I installed senses that the led is lit (or just the signal if you remove the led) and it will disable or enable (depending on the position of the MX-lock) the caps lock within 60 milliseconds.
-
- Location: Belgium, land of Liberty Wafles and Freedom Fries
- Main keyboard: G80-3K with Clears
- Favorite switch: Capacitative BS
- DT Pro Member: 0049
Actually, mod how-tos belong in this forum: they are rarely updated or contributed on, and the time-based sorting of the posts in the thread allow us to see the progress of the mod.
The only problem might be layout or quick links if you want to make a very long explanation. If it is a long article, you could create a "User page" and document it there.
The only problem might be layout or quick links if you want to make a very long explanation. If it is a long article, you could create a "User page" and document it there.
-
- Location: Ålesund, Norway
- DT Pro Member: -
Ok, I will just add it in this thread later tonight, when I get home from work
-
- Location: Ålesund, Norway
- DT Pro Member: -
Here is a quick guide:
Please ask me if you have any questions or if anything is unclear.
I use a transistor to simulate the momentary key-presses that the keyboard controller expects, the base input is connected via a 15K resistor to isolate the signal enough to not mess up the way the keyboard controller scans the switch matrix.
The transistor does not need to be the F422 that I have used, pretty much any NPN transistor is usable as long as you have space for it.
As we all know, most keyboards feature a diode to ensure some kind of support for multiple simultaneous key-presses, this diode is replaced by the transistor, a controllable diode, and the old switch is in effect just shorted.
Next you need to find 5v, gnd and caps lock signal, some keyboards controls the anode of the caps lock LED, some control the cathode, therefore you can measure the two connections on the LED and one of them should be connected to either +5V OR gnd, so here you can connect the appropriate 5V or gnd wire, and the other pin on the LED has the Caps Lock signal that we also need. (see notes regarding the "==" and "!=" in the code, as this changes with the whole anode/cathode-thing)
There is also a 4,7K resistor so that the signal from the switch does not float when the caps lock switch is off.
Electrical drawings:
I planned on using a Attiny85 because I had some lying around, and they are tiny, as the name implies...
Unfortunately I did not have a programmer, but I was lucky to find the following guides for using an arduino as a programmer;
http://hlt.media.mit.edu/?p=1695
http://hlt.media.mit.edu/?p=1706
A added benefit of this was that I could use the simple Arduino code language to program it
and after some simple prototyping using a Arduino Nano, I changed some pin numbers in the program and programmed a attiny with the following code:
Please ask me if you have any questions or if anything is unclear.
I use a transistor to simulate the momentary key-presses that the keyboard controller expects, the base input is connected via a 15K resistor to isolate the signal enough to not mess up the way the keyboard controller scans the switch matrix.
The transistor does not need to be the F422 that I have used, pretty much any NPN transistor is usable as long as you have space for it.
As we all know, most keyboards feature a diode to ensure some kind of support for multiple simultaneous key-presses, this diode is replaced by the transistor, a controllable diode, and the old switch is in effect just shorted.
Next you need to find 5v, gnd and caps lock signal, some keyboards controls the anode of the caps lock LED, some control the cathode, therefore you can measure the two connections on the LED and one of them should be connected to either +5V OR gnd, so here you can connect the appropriate 5V or gnd wire, and the other pin on the LED has the Caps Lock signal that we also need. (see notes regarding the "==" and "!=" in the code, as this changes with the whole anode/cathode-thing)
There is also a 4,7K resistor so that the signal from the switch does not float when the caps lock switch is off.
Electrical drawings:
I planned on using a Attiny85 because I had some lying around, and they are tiny, as the name implies...
Unfortunately I did not have a programmer, but I was lucky to find the following guides for using an arduino as a programmer;
http://hlt.media.mit.edu/?p=1695
http://hlt.media.mit.edu/?p=1706
A added benefit of this was that I could use the simple Arduino code language to program it
and after some simple prototyping using a Arduino Nano, I changed some pin numbers in the program and programmed a attiny with the following code:
Code: Select all
int Lock = 0; // Input pin connected to MX Lock switch
int Capsled = 1; // Input pin connected to Caps Lock LED signal
int SwOut = 2; // Output pin connected to transistor acting as momentary caps lock switch
void setup() {
pinMode(Lock, INPUT);
pinMode(Capsled, INPUT);
pinMode(SwOut, OUTPUT);
}
void loop() {
int LockState = digitalRead(Lock);
int CapsState = digitalRead(Capsled);
if (CapsState == LockState){ // Compares the state of the switch and state of caps lock LED, change the "==" to "!=" if function is reversed
digitalWrite(SwOut, HIGH);
delay(10); // time in milliseconds the simulated caps lock switch is "pressed" increase if key changes are not registered
digitalWrite(SwOut, LOW);
}
delay(50); // delay to increase stability
}
- damorgue
- Location: Sweden
- Main mouse: MX500
- Favorite switch: BS, MX Green and MX Clear
- DT Pro Member: -
- Contact:
Excellent. I am going to add this to all my keyboards. I have MX Lock on some but have always hated that they can get out of sync.
The only thing that bothers me is that if I have two keyboards connected, and both have this feature, then they will fight based on their polling and both will try to set the Caps Lock state to their respective states
The only thing that bothers me is that if I have two keyboards connected, and both have this feature, then they will fight based on their polling and both will try to set the Caps Lock state to their respective states
-
- Location: Ålesund, Norway
- DT Pro Member: -
It is possible to fix this with a small change in the code, if it is a big problem :p
But then you will have to turn the caps lock off/on or on/off to get the keyboard you want to use in sync with the computer.
on another note: I have to order some more MX locks soon, only have one or two left, and need plenty for my next project
But then you will have to turn the caps lock off/on or on/off to get the keyboard you want to use in sync with the computer.
on another note: I have to order some more MX locks soon, only have one or two left, and need plenty for my next project
-
- Location: Stockhom, Sweden
- Main keyboard: Symmetric Stagger Board
- Main mouse: Kinzu
- Favorite switch: Topre
- DT Pro Member: -
It's always fun to see mods like this =) But I can't help feeling that this should be possible to do without a micro controller... I don't know how to do it myself, so all respect to Aleksander so far, but more respect to the one who gives us the ultra simple reverse-latch-whatever-send-a-signal-on-each-state-change solution =D
-
- Location: Ålesund, Norway
- DT Pro Member: -
Yes, there is definately a way to do it but it will need several components, and what is wrong with a single, simple and cheap microcontroller? :p
Also keep in mind that this does not simply just send a pulse on state change, but when the state of the switch does not compare to the state of the caps locks state, so this will never go out of sync
Also keep in mind that this does not simply just send a pulse on state change, but when the state of the switch does not compare to the state of the caps locks state, so this will never go out of sync
- uberben
- Location: Canada
- Main keyboard: Modified Kinesis Essential
- Main mouse: Logitech M570
- DT Pro Member: -
The "simple" solution there is to make your own custom MX locks with solenoids or something in them so that your secondary keyboard can be locked/unlocked when your primary gets presseddamorgue wrote:The only thing that bothers me is that if I have two keyboards connected, and both have this feature, then they will fight based on their polling and both will try to set the Caps Lock state to their respective states
- damorgue
- Location: Sweden
- Main mouse: MX500
- Favorite switch: BS, MX Green and MX Clear
- DT Pro Member: -
- Contact:
Then make an entire keyboard out of that switch and be able to make a self typing keyboard, which depresses its own keys just to freak out my friends.uberben wrote:The "simple" solution there is to make your own custom MX locks with solenoids or something in them so that your secondary keyboard can be locked/unlocked when your primary gets presseddamorgue wrote:The only thing that bothers me is that if I have two keyboards connected, and both have this feature, then they will fight based on their polling and both will try to set the Caps Lock state to their respective states
Nah, not really an issue anyways. I may ask you for further details later.
-
- Location: Ålesund, Norway
- DT Pro Member: -
Challenge accepted!uberben wrote:...make your own custom MX locks with solenoids in them...
-
- Location: United Kingdom
- Main keyboard: Ducky YYY 62g gold springs krytox MX Black sticker
- Main mouse: roccat kone xtd
- Favorite switch: Topre 45g / MX Black 62g lubed
- DT Pro Member: -
Why do you have to go through all this effort with resistors and transistors?
I have a Ducky Shine 2...can I not just unsolder the switch which is there and put an MX LOCK there?
I have a Ducky Shine 2...can I not just unsolder the switch which is there and put an MX LOCK there?
- Daniel Beardsmore
- Location: Hertfordshire, England
- Main keyboard: Filco Majestouch 1 (home)/Poker II backlit (work)
- Main mouse: MS IMO 1.1
- Favorite switch: Probably not whatever I wrote here
- DT Pro Member: -
- Contact:
Why, does the Ducky Shine 2 have support for an alternate action caps lock switch as well as a momentary caps lock switch?
MX Lock is a latching or alternate action switch: when you press it, it stays down, during which time it registers continually as closed. Press it again, and it reverts to open. Normally, caps lock is a momentary switch, i.e. it on registers while you're holding it down with your finger. Each press and release tells the OS to toggle caps lock state.
Try this exercise:
Press caps lock once: the caps lock LED comes on
Now press and hold caps lock down: the caps lock light goes off, yet you're holding the key down!
Caps lock on a normal PC bears no relation to whether the key is pressed. Caps lock state changes every time the key is pressed, not when it's released. Were you to solder in an MX Lock switch, when you press MX Lock down, caps lock instantly engages, without waiting for release. When you press MX Lock again to release it, nothing will happen, as caps lock state changes on press, not release. When you press and lock MX Lock again, caps lock disengages, leaving the switch and the OS in disagreement.
That's also why he's reading the LED state: the OS is free to change caps lock at will, and then the OS and the switch will disagree with each other. His circuit simulates caps lock being pressed again, to force the OS to agree with the switch, since MX Lock visibly displays state by not rising fully when you release the key after it latches.
MX Lock needs to be read differently from a momentary switch, i.e. caps lock is no longer a toggle in RAM, but a toggle in hardware.
MX Lock is a latching or alternate action switch: when you press it, it stays down, during which time it registers continually as closed. Press it again, and it reverts to open. Normally, caps lock is a momentary switch, i.e. it on registers while you're holding it down with your finger. Each press and release tells the OS to toggle caps lock state.
Try this exercise:
Press caps lock once: the caps lock LED comes on
Now press and hold caps lock down: the caps lock light goes off, yet you're holding the key down!
Caps lock on a normal PC bears no relation to whether the key is pressed. Caps lock state changes every time the key is pressed, not when it's released. Were you to solder in an MX Lock switch, when you press MX Lock down, caps lock instantly engages, without waiting for release. When you press MX Lock again to release it, nothing will happen, as caps lock state changes on press, not release. When you press and lock MX Lock again, caps lock disengages, leaving the switch and the OS in disagreement.
That's also why he's reading the LED state: the OS is free to change caps lock at will, and then the OS and the switch will disagree with each other. His circuit simulates caps lock being pressed again, to force the OS to agree with the switch, since MX Lock visibly displays state by not rising fully when you release the key after it latches.
MX Lock needs to be read differently from a momentary switch, i.e. caps lock is no longer a toggle in RAM, but a toggle in hardware.
- Nuum
- Location: Germany
- Main keyboard: KBD8X Mk I (60g Clears), Phantom (Nixdorf Blacks)
- Main mouse: Corsair M65 PRO RGB
- Favorite switch: 60g MX Clears/Brown Alps/Buckling spring
- DT Pro Member: 0084
It would be easier to totally cut the lines to the Caps Lock switch and connect the MX Lock Switch to the Shift switch with some short wires. This way the normal Shift key stays pressed, if you lock the caps lock.
Unfortunately you don't get an LED signal, then. And you can't temporarily unlock caps lock by pressing shift.
It's just easier to do, but your solution seems better.
Edit: Or maybe you could do it with AutoHotKey, e.g. toggle Capslock on key press and untoggle on key release.
Unfortunately you don't get an LED signal, then. And you can't temporarily unlock caps lock by pressing shift.
It's just easier to do, but your solution seems better.
Edit: Or maybe you could do it with AutoHotKey, e.g. toggle Capslock on key press and untoggle on key release.
-
- Location: Ålesund, Norway
- DT Pro Member: -
Daniel pretty much explained the whole thing
you COULD use it as a shiftlock, and a shiftlock comes in handy some times, but there is the problem with all the other stuff that rests on the shift-layer... Typing numbers, ".", "-" etc. would require you to disable the shiftlock.
Also spamming the computer with either shift or capslock commands is not good practice, and if you have a keyboard with a low key roll-off, that also spoils the fun.
you COULD use it as a shiftlock, and a shiftlock comes in handy some times, but there is the problem with all the other stuff that rests on the shift-layer... Typing numbers, ".", "-" etc. would require you to disable the shiftlock.
Also spamming the computer with either shift or capslock commands is not good practice, and if you have a keyboard with a low key roll-off, that also spoils the fun.
-
- Location: United Kingdom
- Main keyboard: Ducky YYY 62g gold springs krytox MX Black sticker
- Main mouse: roccat kone xtd
- Favorite switch: Topre 45g / MX Black 62g lubed
- DT Pro Member: -
Ah sorry, I didn't realise that it constantly registered once depressed. I thought it may have returned upwards somewhat to disengage at the contacts. Good job I didn't go about putting one on my board ill-informed!
Thanks for the great explanation
That shift key method sounds like a good bet!
Thanks for the great explanation
That shift key method sounds like a good bet!
- damorgue
- Location: Sweden
- Main mouse: MX500
- Favorite switch: BS, MX Green and MX Clear
- DT Pro Member: -
- Contact:
For the record, hasu added support for MX Locks to his TMK firmware and it can sync with the OS. Since the OS sends data about the state of the Caps Lock LED, the keyboard knows the state of the OS and can sync them up.
- Daniel Beardsmore
- Location: Hertfordshire, England
- Main keyboard: Filco Majestouch 1 (home)/Poker II backlit (work)
- Main mouse: MS IMO 1.1
- Favorite switch: Probably not whatever I wrote here
- DT Pro Member: -
- Contact:
What you need is a solenoid-drive switch so that when you're swapping between remote sessions, the switch can engage and disengage by itself … Also, MS Word has a feature that can disengage caps lock when it believes that it's enabled by mistake, and it would be funny for that feature to be accompanied by a corresponding click as the caps lock key pops back up.
-
- Location: Ålesund, Norway
- DT Pro Member: -
I actually did this to a Poker today, this time it looks a bit cleaner