Typing unshifted Characters

Is there a way to make a key send a keyboard-report where Shift is always cleared?

So that, even if I held Shift down while pressing that key, it would still send a report that acted as if I temporarily released shift before typing?

Background: I’m using a layer to type all kinds of special characters like parenthesis. Since I’m using a german keyboard layout most of them happen to be shifted. Unfortunately the two angle brackets ‘<’ and ‘>’ happen to be on the same physical key. One is typed as shifted character the other is typed as an unshifted character. If I type them in quick succession like in an SQL-Statement the second one doesn’t get recognized because the change in the shift state is not yet send to the host and so the keypress gets lost.

Congratulations! You just found a case I hadn’t considered yet!

This is a tricky one, because you don’t just need to clear the shift keycodes; you also need to send a report with the angle bracket keycode cleared. Usually, the rollover problem is the inverse — keycodes getting cleared when they’re not intended, resulting in repeated characters.

I think this can be solved for now by using a macro, but it’s non-trivial. I’ll have a look at it sometime tomorrow, probably.

Long term, I’m working on a plugin that would deal with this problem, but it’s probably too difficult to write for today’s Kaleidoscope; it should be fairly straightforward in the experimental fork that I’m working on. That might be ready for people to try out in a few weeks, but it’s not usable yet.

Thank you for your answer. I thought about the macro and I’m going to implement that solution. At the moment I’m experiencing that issue mainly with the two angle brackets. Potentially it could also come up with ‘-’ and ‘_’ but since they are on different keyboard-halfs it is rather unlikely that I’m going to be fast enough to hit them both at nearly the same time.

I’m curious to see what your fork is going to do differently. Let me know when you’re ready to talk about it.

The Macro Version works like a charm.

    case MACRO_LESSTHAN:
      return MACRODOWN(I(10), U(LeftShift), T(de_LessThan));
      
    case MACRO_GREATERTHAN:
      return MACRODOWN(I(10), D(LeftShift), T(de_LessThan), U(LeftShift));

Any concerns about the U(LeftShift) without a conditional to check whether Shift was pressed in the first place or not? It doesn’t seem to create any problems when typing. Whether I hold shift or not I get the characters I want. I so love this keyboard! :slight_smile:

2 Likes

No, that won’t cause any problems; “releasing” a key doesn’t send a “key release” event to the host, it just clears that key’s bit from the ensuing USB HID report. If that bit was already zero, it simply stays that way.