-
Notifications
You must be signed in to change notification settings - Fork 27
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 abort-to-latin
and abort-to-latin-unhandled
command
#48
Add abort-to-latin
and abort-to-latin-unhandled
command
#48
Conversation
429f933
to
b77fed7
Compare
abort-to-latin
and abort-to-latin-passthrough
commandabort-to-latin
and abort-to-latin-passthrough
command
b77fed7
to
cee92fc
Compare
abort-to-latin
and abort-to-latin-passthrough
commandabort-to-latin
and abort-to-latin-passthrough
command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to have a test case for this; you can put a custom rule in tests/rules
and check it with check_transitions
.
libskk/state.vala
Outdated
bool retval; | ||
if (command == "abort" || | ||
command == "abort-to-latin" || | ||
command == "abort-to-latin-passthrough") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is commit-unhandled
where -unhandled
means the same thing as -passthrough
here. I rather like the latter, though.
cee92fc
to
f656399
Compare
* Renamed `abort-to-latin-passthrough` command to `abort-to-latin-unhandled` * Renamed a variable `allow_passthrough` to `event_handled`. Note that they use inverse values to represent states, i.e. "event is handled" means "passthrough is *NOT* allowed", and vice versa. See <ueno#48 (comment)>.
I'm going to write a test. |
I realized that I can't write complete tests because of #49 (it prevents me from using custom rule during dict edit)... orz |
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.
* Renamed `abort-to-latin-passthrough` command to `abort-to-latin-unhandled` * Renamed a variable `allow_passthrough` to `event_handled`. Note that they use inverse values to represent states, i.e. "event is handled" means "passthrough is *NOT* allowed", and vice versa. See <ueno#48 (comment)>.
f656399
to
1495c4e
Compare
Added tests, but they can't (or I don't know how to) represent "unhandled" key event behaviour. |
abort-to-latin
and abort-to-latin-passthrough
commandabort-to-latin
and abort-to-latin-unhandled
command
* Renamed `abort-to-latin-passthrough` command to `abort-to-latin-unhandled` * Renamed a variable `allow_passthrough` to `event_handled`. Note that they use inverse values to represent states, i.e. "event is handled" means "passthrough is *NOT* allowed", and vice versa. See <#48 (comment)>.
OK, I will adjust the test later; thanks anyway! |
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-unhandled
does "abort
, then change to latin inputmode, 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:
abort-to-latin-unhandled
does not consume the key event even if thestate 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.