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
base: master
from

Conversation

Projects
None yet
3 participants
@lo48576
Copy link
Contributor

lo48576 commented Jan 20, 2018

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

@coveralls

This comment has been minimized.

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 added a commit to lo48576/libskk that referenced this pull request Jan 20, 2018

Add `abort-to-latin` and `abort-to-latin-passthrough` command
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 added a commit to lo48576/libskk that referenced this pull request Jan 20, 2018

Add `abort-to-latin` and `abort-to-latin-passthrough` command
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

This comment has been minimized.

Copy link
Contributor

lo48576 commented Jan 21, 2018

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

@ueno

ueno approved these changes Jan 22, 2018

Copy link
Owner

ueno left a comment

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 added a commit to lo48576/libskk that referenced this pull request Jan 22, 2018

Add `abort-to-latin` and `abort-to-latin-passthrough` command
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 added a commit to lo48576/libskk that referenced this pull request Jan 22, 2018

Add `abort-to-latin` and `abort-to-latin-passthrough` command
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 added a commit to lo48576/libskk that referenced this pull request Jan 22, 2018

Add `abort-to-latin` and `abort-to-latin-passthrough` command
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

This comment has been minimized.

Copy link
Contributor

lo48576 commented Jan 22, 2018

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

lo48576 added some commits Jan 20, 2018

Add `Escape` keyval name
By this change, "Escape" can be used to represent escape key in keymap
rules.
Revert "Use keysym `Henkan` and `Muhenkan` instead of `lshift` and `r…
…shift`"

This reverts commit b543ed1.

NICOLA wants "lshift" and "rshift" keysyms.
See <#47 (review)>
for detail.
Add workaround to use `{Muh,H}enkan` as alias to `{l,r}shift`
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 lo48576:feature/enable-escape-keymap branch from b543ed1 to 75648cf Jan 22, 2018

@lo48576

This comment has been minimized.

Copy link
Contributor

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 added a commit that referenced this pull request Jan 23, 2018

Add `abort-to-latin` and `abort-to-latin-passthrough` command
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

This comment has been minimized.

Copy link
Contributor

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 lo48576:feature/enable-escape-keymap branch Sep 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment