Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caps lock for umlaut combinations #4092

Open
JohnSass opened this issue Jan 7, 2025 · 0 comments
Open

Caps lock for umlaut combinations #4092

JohnSass opened this issue Jan 7, 2025 · 0 comments

Comments

@JohnSass
Copy link

JohnSass commented Jan 7, 2025

I'm having trouble with creating a complex modification for emulating English International Keyboards in Windows, specifically for typing Swedish characters (å, ä and ö). Everything is working fine, except for when caps lock is involved.

I'll stick to ä for this report. The behaviour I want is for opt-q to produce ä, which would be produced on Macs British keyboard with opt-u a, for creating an umlaut (¨) followed by a a, which combines to create an ä. I can achieve this behaviour with this manipulator:

{
            "from": {
                "key_code": "q",
                "modifiers": { "mandatory": ["option"] }
            },
            "to": [
                {
                    "key_code": "u",
                    "modifiers": ["option"]
                },
                { "key_code": "a" }
            ],
            "type": "basic"
}

The problem is when we include shift and caps lock - we only want the shift modifier to affect the second key press, since shift-opt-u produces another symbol than an umlaut (the correct key press for Ä would be opt-u shift-a). This can easily be achieved with this manipulator:

{
            "from": {
                "key_code": "q",
                "modifiers": { "mandatory": ["option", "shift"] }
            },
            "to": [
                {
                    "key_code": "u",
                    "modifiers": ["option"]
                },
                {
                    "key_code": "a",
                    "modifiers": ["shift"]
                }
            ],
            "type": "basic"
}

And this works too! The problem is that I can't find any manipulator for handling caps lock (since caps lock: opt-u produces the same character as shift-opt-u). I attempted this one:

{
            "from": {
                "key_code": "q",
                "modifiers": { "mandatory": ["option", "caps_lock"] }
            },
            "to": [
                {
                    "key_code": "u",
                    "modifiers": ["option"]
                },
                {
                    "key_code": "a",
                    "modifiers": ["shift"]
                }
            ],
            "type": "basic"
}

That one correctly produces an Ä symbol, but it also seems to turn off the caps lock state - for example, pressing caps_lock opt-q q produces Äq - note that the q is lowercase. According to the event viewer, the key presses produce these events:

[
  {
    "type": "down",
    "name": {"key_code":"caps_lock"},
    "usagePage": "7 (0x0007)",
    "usage": "57 (0x0039)",
    "misc": ""
  },
  {
    "type": "up",
    "name": {"key_code":"caps_lock"},
    "usagePage": "7 (0x0007)",
    "usage": "57 (0x0039)",
    "misc": ""
  },
  {
    "type": "down",
    "name": {"key_code":"right_option"},
    "usagePage": "7 (0x0007)",
    "usage": "230 (0x00e6)",
    "misc": "flags right_option"
  },
  {
    "type": "down",
    "name": {"key_code":"left_option"},
    "usagePage": "7 (0x0007)",
    "usage": "226 (0x00e2)",
    "misc": "flags left_option,right_option"
  },
  {
    "type": "up",
    "name": {"key_code":"right_option"},
    "usagePage": "7 (0x0007)",
    "usage": "230 (0x00e6)",
    "misc": "flags left_option"
  },
  {
    "type": "down",
    "name": {"key_code":"caps_lock"},
    "usagePage": "7 (0x0007)",
    "usage": "57 (0x0039)",
    "misc": "flags left_option"
  },
  {
    "type": "up",
    "name": {"key_code":"caps_lock"},
    "usagePage": "7 (0x0007)",
    "usage": "57 (0x0039)",
    "misc": "flags left_option"
  },
  {
    "type": "down",
    "name": {"key_code":"u"},
    "usagePage": "7 (0x0007)",
    "usage": "24 (0x0018)",
    "misc": "flags left_option"
  },
  {
    "type": "up",
    "name": {"key_code":"u"},
    "usagePage": "7 (0x0007)",
    "usage": "24 (0x0018)",
    "misc": "flags left_option"
  },
  {
    "type": "down",
    "name": {"key_code":"left_shift"},
    "usagePage": "7 (0x0007)",
    "usage": "225 (0x00e1)",
    "misc": "flags left_option,left_shift"
  },
  {
    "type": "up",
    "name": {"key_code":"left_option"},
    "usagePage": "7 (0x0007)",
    "usage": "226 (0x00e2)",
    "misc": "flags left_shift"
  },
  {
    "type": "down",
    "name": {"key_code":"caps_lock"},
    "usagePage": "7 (0x0007)",
    "usage": "57 (0x0039)",
    "misc": "flags left_shift"
  },
  {
    "type": "up",
    "name": {"key_code":"caps_lock"},
    "usagePage": "7 (0x0007)",
    "usage": "57 (0x0039)",
    "misc": "flags left_shift"
  },
  {
    "type": "down",
    "name": {"key_code":"a"},
    "usagePage": "7 (0x0007)",
    "usage": "4 (0x0004)",
    "misc": "flags left_shift"
  },
  {
    "type": "up",
    "name": {"key_code":"a"},
    "usagePage": "7 (0x0007)",
    "usage": "4 (0x0004)",
    "misc": "flags left_shift"
  },
  {
    "type": "up",
    "name": {"key_code":"left_shift"},
    "usagePage": "7 (0x0007)",
    "usage": "225 (0x00e1)",
    "misc": ""
  },
  {
    "type": "down",
    "name": {"key_code":"caps_lock"},
    "usagePage": "7 (0x0007)",
    "usage": "57 (0x0039)",
    "misc": ""
  },
  {
    "type": "up",
    "name": {"key_code":"caps_lock"},
    "usagePage": "7 (0x0007)",
    "usage": "57 (0x0039)",
    "misc": ""
  },
  {
    "type": "down",
    "name": {"key_code":"q"},
    "usagePage": "7 (0x0007)",
    "usage": "20 (0x0014)",
    "misc": ""
  },
  {
    "type": "up",
    "name": {"key_code":"q"},
    "usagePage": "7 (0x0007)",
    "usage": "20 (0x0014)",
    "misc": ""
  }
]

Can I ask if this is expected behavior, and if so what the intention for handling caps lock state is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant