Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Canop/crokey
/ functions
Functions
63 in github.com/Canop/crokey
⨍
Functions
63
◇
Types & classes
7
↓ 24 callers
Function
check_ok
(raw: &str, key: KeyCombination)
src/parse.rs:146
↓ 14 callers
Method
to_string
return the key formatted into a string `format.to_string(key)` is equivalent to `format.format(key).to_string()`.
src/format.rs:128
↓ 13 callers
Method
into
(self)
src/key_combination.rs:189
↓ 4 callers
Method
combine
Take all the `down_keys`, combine them into a `KeyCombination`
src/combiner.rs:112
↓ 3 callers
Function
normalize_key_code
Change the char to uppercase when the modifier shift is present, otherwise if the char is uppercase, return true. If the key is the '\r' or '\n' char,
src/key_combination.rs:36
↓ 3 callers
Function
parse_key_code
must be kept identical to crokey::parse_key_code (and yes, this duplication isn't ideal)
src/proc_macros/mod.rs:33
↓ 2 callers
Method
format
return a wrapper of the key implementing Display ``` use crokey::*; let format = KeyCombinationFormat::default(); let k = format.format(key!(f6)); le
src/format.rs:122
↓ 2 callers
Method
normalized
Return a normailzed version of the combination. Fix the case of the code to uppercase if the shift modifier is present. Add the SHIFT modifier if one
src/key_combination.rs:81
↓ 2 callers
Function
parse
parse a string as a keyboard key combination definition. About the case: The char we receive as code from crossterm is usually lowercase but uppercas
src/parse.rs:104
↓ 2 callers
Function
pop_keyboard_enhancement_flags
Restore the "normal" state of the terminal. This is done automatically by the combiner on drop, so you should usually not need to call this function.
src/combiner.rs:231
↓ 1 callers
Method
cmp
(&self, other: &Self)
src/key_combination.rs:151
↓ 1 callers
Method
enable_combining
Try to enable combining more than one non-modifier key into a combination. Return Ok(false) when the terminal doesn't support the kitty protocol. Be
src/combiner.rs:64
↓ 1 callers
Function
is_key_simple
For the purpose of key combination, we consider that a key is "simple" when it's neither a modifier (ctrl,alt,shift) nor a space.
src/combiner.rs:199
↓ 1 callers
Function
key_code_to_token_stream
(key_code: KeyCode, code_span: Span)
src/proc_macros/mod.rs:102
↓ 1 callers
Function
parse_key_code
(raw: &str, shift: bool)
src/parse.rs:38
↓ 1 callers
Function
push_keyboard_enhancement_flags
Change the state of the terminal to enable combining keys. This is done automatically by `Combiner::enable_combining` so you should usually not need t
src/combiner.rs:215
↓ 1 callers
Method
transform
Receive a key event and return a key combination if one is ready. When combining is enabled, the key combination is only returned on a key release ev
src/combiner.rs:130
↓ 1 callers
Method
transform_ansi
In ansi mode, no combination is possible, and we don't expect to receive anything else than a single key or than key presses.
src/combiner.rs:185
↓ 1 callers
Method
transform_combining
(&mut self, key: KeyEvent)
src/combiner.rs:137
Function
as_letter
Return the raw char if the crossterm key event is a letter event. Case of the code is not normalized, just as in the original event.
src/key_event.rs:8
Method
as_letter
return the raw char if the combination is a letter event
src/key_combination.rs:95
Function
check_key_parsing
()
src/parse.rs:144
Method
default
()
src/combiner.rs:42
Method
default
()
src/format.rs:72
Method
deserialize
(deserializer: D)
src/key_combination.rs:108
Method
disable_combining
Disable combining.
src/combiner.rs:82
Method
drop
(&mut self)
src/combiner.rs:205
Method
fmt
(&self, f: &mut fmt::Formatter<'_>)
src/parse.rs:31
Method
fmt
(&self, f: &mut fmt::Formatter)
src/format.rs:139
Method
fmt
(&self, f: &mut fmt::Formatter)
src/key_combination.rs:135
Function
format
()
src/lib.rs:335
Method
from
(key_event: KeyEvent)
src/key_combination.rs:141
Method
from_str
(s: &str)
src/key_combination.rs:129
Function
hygiene
()
tests/hygiene.rs:5
Method
is_ansi_compatible
Ansi terminals don't manage key press/release/repeat, so they don't allow to determine whether 2 keys are pressed at the same time. This means a combi
src/key_combination.rs:70
Method
is_combining
(&self)
src/combiner.rs:97
Function
key
()
src/lib.rs:277
Function
key
(input: TokenStream1)
src/proc_macros/mod.rs:229
Function
key_pattern
()
src/lib.rs:346
Function
main
()
tests/ui/invalid-modifier.rs:1
Function
main
()
tests/ui/duplicate-modifier.rs:1
Function
main
()
tests/ui/unexpected-eof.rs:1
Function
main
()
tests/ui/invalid-key.rs:1
Function
main
()
examples/deser_keybindings/src/main.rs:36
Function
main
()
examples/print_key/src/main.rs:11
Function
main
()
examples/print_key_no_combiner/src/main.rs:11
Method
new
(s: S)
src/parse.rs:25
Method
new
Create a new `KeyCombination` from one to three keycodes and a set of modifiers
src/key_combination.rs:55
Function
no_mod
(code: KeyCode)
src/lib.rs:272
Method
one_key
Create a new `KeyCombination` from one keycode and a set of modifiers
src/key_combination.rs:60
Method
parse
(input: ParseStream<'_>)
src/proc_macros/mod.rs:142
Method
partial_cmp
(&self, other: &Self)
src/key_combination.rs:156
Method
serialize
(&self, serializer: S)
src/key_combination.rs:119
Method
set_keyboard_enhancement_flags_externally_managed
Tell the Combiner not to push/pop the keyboard enhancement flags. Call before `enable_combining` if you want to manage the flags yourself. (for examp
src/combiner.rs:94
Method
set_mandate_modifier_for_multiple_keys
When combining is enabled, you may either want "simple" keys (i.e. without modifier or space) to be handled on key press, or to wait for a key release
src/combiner.rs:108
Method
try_from
Try to create a `KeyCombination` from a slice of key events, will fail if and only if the slice is empty.
src/key_combination.rs:165
Function
ui
()
src/lib.rs:361
Method
with_alt
(mut self, s: S)
src/format.rs:100
Method
with_command
(mut self, s: S)
src/format.rs:96
Method
with_control
(mut self, s: S)
src/format.rs:92
Method
with_implicit_shift
(mut self)
src/format.rs:108
Method
with_lowercase_modifiers
(mut self)
src/format.rs:86
Method
with_shift
(mut self, s: S)
src/format.rs:104