Sounds like a problem with the pegasus hoof map. It still happens when you map something else, right?
scratch that. I see on the SWE layout the* and ' are both on the same key. I'm slightly confused by your description but I think I get the problem. Are you saying that if you hold down SHIFT and keep pressing ', it causes the problem? What if you just press it once?
If I map HID_KEYBOARD_SC_NON_US_HASHMARK_AND_TILDE to some other key, then it happens on that other key. So it's not on Pegasus Hoof map, right?
As you say it's probably because both symbols are on the same key in ISO layout as opposed to two separate keys in ANSI. Interestingly there is another such key in ISO layout, HID_KEYBOARD_SC_NON_US_BACKSLASH_AND_PIPE, but this one seems to work as it should.
Here is exactly how the problematic key behaves now:
- Press and release ' works. Result: '
- Keep ' pressed works. Result: '<delay>''''''''''''
- Press Shift then ', then release both. Doesn't work. Result: * or *' depending on which key is released first. Even slightest difference matters.
- Keep Shift and ' pressed. Works. Result: *<delay>************** (and so on) until relese when above might happen.
So the problem is releasing Shift-'. It often registers as two symbols as there is no delay in between * and '. (they are handled like they were two different physical keys).
Compare to normally behaving shifted key. For example:
- Press Shift then a, then release both. Result: A (even if you release Shift slightly before)
The problem is just the same with all ISO layouts e.g. # and ~ in ISO UK.
Country specific layouts are done on the OS side so they don't affect it.
[EDIT] I also noticed a problem with non-shifted HID_KEYBOARD_SC_NON_US_HASHMARK_AND_TILDE.
When typing on this firmware I've began to make a typo don't' when I type don't. Trying to hunt down the reason I noticed a weird behaviour (probably just another symptom of the same bug).
Normally autorepeat of a key stops when pressing some other key.
For example, keeping + pressed down and hitting g once: ++++++++++g<full stop>
But with HID_KEYBOARD_SC_NON_US_HASHMARK_AND_TILDE it just pauses briefly (and not even instantly) after hitting g and then goes on:
'''''''''''g''<pause>'''''''''''