Replies: 7 comments 9 replies
-
Nice. I see you didn't forget how to read and write C code :) What I like is that your solution is clean and straight forward.
What I've been thinking about is along the lines of a "consider capslock state" flag
The "CLS" would tell processCombo to not use the plain Shift state, but first calculate the 'effective shift state' (CapslockState XOR Shift). I'm unhappy with the .ini syntax, though. |
Beta Was this translation helpful? Give feedback.
-
I'm also thinking of retiring the AltChar system, or support two systems. If you want to try it out, replace your
|
Beta Was this translation helpful? Give feedback.
-
I chewed on this problem a bit recently. The design in my head is a) SendInput would be an addition to altChar, not a replacement. It should allow strings ("Hello"). Probably confusing for newbies why this doesn't always work. b) altChar could be extended like this:
Open questions:
|
Beta Was this translation helpful? Give feedback.
-
I looked at your code (kinda forgot it since it appeared in the middle of this thread). I probably don't understand it completely, but it looks like it should work. Just some loose thoughts below... Its weakness (as I see it) is that you have a lot of logic that implements a quasi generic solution for a problem class, but, at the end of the day, can only cover a very specific case (shiftlock). That could have been easier with specific code triggered by For a truly generic solution, you probably want to define that 'capsLock state' is a modifier (which it is, basically). An option that might be easier to understand would be '1' instead of 'xor', testing that exactly 1 of the modifiers is down. The ini symbol ^ is a bit unfortunate, in hindsight. Down v Up ^ is intuitive, but inconsistent with the C symbols & | ^ ~ ... |
Beta Was this translation helpful? Give feedback.
-
The first question would be, why do you want to change the result of a keypress depending on NumLock and ScrLock? To solve the "capslock with altChar()" issue, my favorite solution still is some kind of Implementation is a bit convoluted, since the config reader can only pass keys (and key sequences) to the core. In config, translate altCharIfCaps(123,456) to the key sequence (or define a 2nd vk: "VK_CPS_IFCAPS 1 2 3 VK_CPS_ELSECAPS 4 5 6", bit easier to read but an extra VK Then in playKeyEventSequence() That of course handles only the very specific issue, but it does it well (probably). |
Beta Was this translation helpful? Give feedback.
-
First question is, do you aim to develop something cool, or do you want to solve your issue at hand...
|
Beta Was this translation helpful? Give feedback.
-
Option 1: a killer feature of dedicated cursor keys is that you can easily feel them. Always takes brain activity to position your hand over jkl; Option 3: shouldn't be too hard, but, I have no clear vision how that should work. My favorite for my own config would probably be two dedicated combos, like Edit: no longer like the approach below, after writing and reading it... GLOBAL ToggleConfigKey NUMLOCK 1/3 //toggle config 1 / 3 would cover all common cases. Still need to define when/which LED lights up, so you could toggle with Numpad+ and show state with NumLock LED. Getting a bit complicated. |
Beta Was this translation helpful? Give feedback.
-
It would be useful to have access to the state of *Lock keys (CapsLock, NumLock, ScrollLock) and possible other toggle keys (on Asian keyboards, I think) in combo rules. Currently we have modifiers with a state up, down or tapped. Toggled could be a fourth state of a modifier,
Another approach could be to introduce special modifiers that represent the state of a toggle key. There is a precedent in the CAPSON virtual key that can be sent. Those could be defined in code, like CAPSON.
A third approach could be a mapping syntax to make one of the current virtual modifiers MOD9 - MOD15 reflect the state of a toggle key, with a mapping defined in a configuration with new syntax. Perhaps another variant of REWIRE, or a new keyword.
As an example of what I would like to accomplish, see the following configuration, that uses a currently non-existent modifier MOD16, which in this example somehow reflects the toggle state of the CapsLock key.
As a proof of concept I added support for this state by hardcoding it in capsicain.cpp function processCombos. (That is the second approach described above.)
With this modification, the example given above actually works as intended.
Beta Was this translation helpful? Give feedback.
All reactions