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

Chaining dead keys #14

Closed
wismill opened this issue Mar 22, 2018 · 1 comment
Closed

Chaining dead keys #14

wismill opened this issue Mar 22, 2018 · 1 comment

Comments

@wismill
Copy link
Contributor

wismill commented Mar 22, 2018

Hello, I would like to use chained dead keys, but I do not manage to make it work. Is it supported?
For example, in the following simplified example I would like to obtain:

  • ~ + u : ú
  • ~ + ~ + u: ű

It does not work with AHK.

{
  "shiftlevels": [ "None", "Shift" ],
  "keys": [
    { "pos": "~", "letters": [ "cdk:test1" ] }
  ],
  "customDeadKeys": [
    {
      "name": "test1",
      "stringMap": [
        [ "cdk:test1", "cdk:test2" ],
        [ "u", "ú"]
      ]
    },
    {
      "name": "test2",
      "stringMap": [
        [ "u", "ű" ]
      ]
    }
  ]
}
39aldo39 added a commit that referenced this issue Mar 23, 2018
* Add support for dead keys in the left side of the stringMap
* Improve the handling of dead keys in AHK
@39aldo39
Copy link
Owner

Chained dead keys such as your example are supported. However, you have to specify them a bit differently. I should add an example of it in the documentation.

You have two ways of specifying the dead key you want. One way is to use the 'nested dead key' feature of AHK (and PKL).

{
  "name": "test1",
  "stringMap": [
    [ "u", "ú" ],
    [ "ú", "ű" ]
  ]
}

This example works since dead keys can nest:

test1 + test1 + u → test1 + (test1 + u) → test1 + ú → ű

This is also very useful in combination with other dead keys, since the 'ú' can also be the result of a different dead key.

Another way is to, as you did, use dead keys in dead keys. However, currently your "cdk:test1" and "cdk:test2" are interpreted as strings. If you press 'test1', followed by the letters "cdk:test1" you get the string "cdk:test2". If you don't want strings, you have to give a list of letters. I have added support for dead keys in these lists.

Also, you don't have to create additional dead keys, KLFC does that for you! This means that your example simply becomes

{
  "name": "test2",
  "stringMap": [
    [ "u", "ú" ],
    [ ["cdk:test2","u"], "ű" ]
  ]
}

There were also a few bugs in the AHK implementation, which didn't allow a dead key to combine with itself. This should be fixed now.

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

2 participants