glyph picker
This commit is contained in:
@@ -33,6 +33,8 @@ pub enum InputMode {
|
||||
Dialog,
|
||||
/// The script code editor is open; all input drives the editor.
|
||||
CodeEditor,
|
||||
/// The glyph picker is open over the editor; all input drives the picker.
|
||||
GlyphDialog,
|
||||
/// An animation is running and has not claimed any input mode; all input is discarded.
|
||||
Ignore,
|
||||
/// Reserved for a post-transition freeze; nothing currently produces this mode.
|
||||
@@ -54,7 +56,9 @@ pub(crate) fn current_input_mode(mode: &Mode, ui: &Ui) -> InputMode {
|
||||
}
|
||||
match mode {
|
||||
Mode::Edit(ed) => {
|
||||
if ed.dialog.is_some() {
|
||||
if ed.glyph_dialog.is_some() {
|
||||
InputMode::GlyphDialog
|
||||
} else if ed.dialog.is_some() {
|
||||
InputMode::Dialog
|
||||
} else if ed.code_editor.is_some() {
|
||||
InputMode::CodeEditor
|
||||
@@ -122,6 +126,8 @@ pub(crate) fn handle_editor_input(event: Event, term_w: u16, ed: &mut EditorStat
|
||||
KeyCode::Left => ed.move_cursor(-1, 0),
|
||||
KeyCode::Right => ed.move_cursor(1, 0),
|
||||
KeyCode::Char('l') => ui.log.toggle(),
|
||||
// `g` opens the glyph picker for the cell under the cursor.
|
||||
KeyCode::Char('g') => ed.open_glyph_picker(),
|
||||
// A menu letter opens its dialog; unmatched letters are ignored.
|
||||
KeyCode::Char(c) => {
|
||||
ed.menu_key(c);
|
||||
|
||||
Reference in New Issue
Block a user