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

Add Escape, Henkan, Muhenkan keyval names #47

Closed
wants to merge 4 commits into from

Conversation

lo48576
Copy link
Contributor

@lo48576 lo48576 commented Jan 20, 2018

By this change, "Escape" can be used to represent escape key in keymap rules.

@coveralls
Copy link

coveralls commented Jan 20, 2018

Coverage Status

Coverage decreased (-0.03%) to 79.76% when pulling 75648cf on lo48576:feature/enable-escape-keymap into 94e57ba on ueno:master.

lo48576 pushed a commit to lo48576/libskk that referenced this pull request Jan 20, 2018
This change and PR ueno#47 (`Escape` keymap) enables us to use
"vi-cooperative" keymap.

`abort-to-latin` does "`abort`, then change to latin input mode".
If the state changes on abort or mode change, key event is consumed.

`abort-to-latin-passthrough` does "`abort`, then change to latin input
mode, and let key event pass-through".

"vi-cooperative" keymap will be achived by config such as the code below:

```json
{
  "include": [
    "default"
  ],
  "define": {
    "keymap": {
      "Escape": "abort-to-latin-passthrough",
    }
  }
}
```

`abort-to-latin-passthrough` does not consume the key event even if the
state changed.
So, when the user type "C-j Esc" under the config above, application
will receive "Esc" key event, in contrast to `abort-to-latin` command.
lo48576 pushed a commit to lo48576/libskk that referenced this pull request Jan 20, 2018
This change and PR ueno#47 (`Escape` keymap) enables us to use
"vi-cooperative" keymap.

`abort-to-latin` does "`abort`, then change to latin input mode".
If the state changes on abort or mode change, key event is consumed.

`abort-to-latin-passthrough` does "`abort`, then change to latin input
mode, and let key event pass-through".

"vi-cooperative" keymap will be achived by config such as the code below:

```json
{
  "include": [
    "default"
  ],
  "define": {
    "keymap": {
      "Escape": "abort-to-latin-passthrough",
    }
  }
}
```

`abort-to-latin-passthrough` does not consume the key event even if the
state changed.
So, when the user type "C-j Esc" under the config above, application
will receive "Esc" key event, in contrast to `abort-to-latin` command.
@lo48576 lo48576 changed the title Add Escape keyval name Add Escape, Henkan, Muhenkan keyval names Jan 21, 2018
@lo48576
Copy link
Contributor Author

lo48576 commented Jan 21, 2018

Add names Henkan and Muhenkan.
This will solve #38.

Copy link
Owner

@ueno ueno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change itself looks good, though we would need to find a way to map these keysyms to lshift/rshift for NICOLA. Also, for the long run, it might make more sense to switch to using binary search on the keysym table provided by libxkbcommon:
ueno/libkkc@0bfe596

lo48576 pushed a commit to lo48576/libskk that referenced this pull request Jan 22, 2018
This change and PR ueno#47 (`Escape` keymap) enables us to use
"vi-cooperative" keymap.

`abort-to-latin` does "`abort`, then change to latin input mode".
If the state changes on abort or mode change, key event is consumed.

`abort-to-latin-passthrough` does "`abort`, then change to latin input
mode, and let key event pass-through".

"vi-cooperative" keymap will be achived by config such as the code below:

```json
{
  "include": [
    "default"
  ],
  "define": {
    "keymap": {
      "Escape": "abort-to-latin-passthrough",
    }
  }
}
```

`abort-to-latin-passthrough` does not consume the key event even if the
state changed.
So, when the user type "C-j Esc" under the config above, application
will receive "Esc" key event, in contrast to `abort-to-latin` command.
lo48576 pushed a commit to lo48576/libskk that referenced this pull request Jan 22, 2018
This change and PR ueno#47 (`Escape` keymap) enables us to use
"vi-cooperative" keymap.

`abort-to-latin` does "`abort`, then change to latin input mode".
If the state changes on abort or mode change, key event is consumed.

`abort-to-latin-passthrough` does "`abort`, then change to latin input
mode, and let key event pass-through when no input string is discarded".

"vi-cooperative" keymap will be achived by config such as the code below:

```json
{
  "include": [
    "default"
  ],
  "define": {
    "keymap": {
      "Escape": "abort-to-latin-passthrough",
    }
  }
}
```

`abort-to-latin-passthrough` does not consume the key event even if the
state changed.
So, when the user type "C-j Esc" under the config above, application
will receive "Esc" key event, in contrast to `abort-to-latin` command.
lo48576 pushed a commit to lo48576/libskk that referenced this pull request Jan 22, 2018
This change and PR ueno#47 (`Escape` keymap) enables us to use
"vi-cooperative" keymap.

`abort-to-latin` does "`abort`, then change to latin input mode".
If the state changes on abort or mode change, key event is consumed.

`abort-to-latin-passthrough` does "`abort`, then change to latin input
mode, and let key event pass-through when no input string is discarded".

"vi-cooperative" keymap will be achived by config such as the code below:

```json
{
  "include": [
    "default"
  ],
  "define": {
    "keymap": {
      "Escape": "abort-to-latin-passthrough",
    }
  }
}
```

`abort-to-latin-passthrough` does not consume the key event even if the
state changed.
So, when the user type "C-j Esc" under the config above, application
will receive "Esc" key event, in contrast to `abort-to-latin` command.
@lo48576
Copy link
Contributor Author

lo48576 commented Jan 22, 2018

So, at this time (in this PR), b543ed1 (lshift/rshift rename) should be reverted (or resetted)?

YOSHIOKA Takuma added 4 commits January 23, 2018 02:40
By this change, "Escape" can be used to represent escape key in keymap
rules.
…shift`"

This reverts commit b543ed1.

NICOLA wants "lshift" and "rshift" keysyms.
See <ueno#47 (review)>
for detail.
By this way, "lshift" and "rshift" keyval names are preserved, and
"Muhenkan" and "Henkan" can be used in typing rules config.
@lo48576 lo48576 force-pushed the feature/enable-escape-keymap branch from b543ed1 to 75648cf Compare January 22, 2018 17:58
@lo48576
Copy link
Contributor Author

lo48576 commented Jan 22, 2018

Reverted the change of keysyms mapping, and added (temporary) workaround.
Now KeyEvent.from_string() treats "Muhenkan" and "Henkan" as alias of "lshift" and "rshift".

This logic is (currently) only used to load keymap rules and to emulate key sequences by string,
so it doesn't affect real keyboard input event processing.

ueno pushed a commit that referenced this pull request Jan 23, 2018
This change and PR #47 (`Escape` keymap) enables us to use
"vi-cooperative" keymap.

`abort-to-latin` does "`abort`, then change to latin input mode".
If the state changes on abort or mode change, key event is consumed.

`abort-to-latin-passthrough` does "`abort`, then change to latin input
mode, and let key event pass-through when no input string is discarded".

"vi-cooperative" keymap will be achived by config such as the code below:

```json
{
  "include": [
    "default"
  ],
  "define": {
    "keymap": {
      "Escape": "abort-to-latin-passthrough",
    }
  }
}
```

`abort-to-latin-passthrough` does not consume the key event even if the
state changed.
So, when the user type "C-j Esc" under the config above, application
will receive "Esc" key event, in contrast to `abort-to-latin` command.
@lo48576
Copy link
Contributor Author

lo48576 commented Sep 8, 2018

#54 is merged and it enables the keys to be mapped, so closing this PR.

@lo48576 lo48576 closed this Sep 8, 2018
@lo48576 lo48576 deleted the feature/enable-escape-keymap branch September 20, 2018 15:32
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

Successfully merging this pull request may close these issues.

3 participants