Commit Graph
34 Commits
Author SHA1 Message Date
skylartaylor 0f46902e32 Reconcile egui 0.37 with current shared libraries
Preserve the reviewed shared UI tree and the frozen app dependency commit while
bringing in current main. Port the new keymap UI APIs and use verified central
fonts in its strict UI tests and snapshots.
2026-10-24 07:20:20 +02:00
aiongg 332a4456dd Merge #186: keymap: Keyboard Shortcuts dialog, named shortcut sets and the shortcut editor
# Conflicts:
#	crates/keymap/src/lib.rs
2026-10-24 02:29:57 +00:00
aiongg 135981286f keymap: a layout switch forgets what letter positions typed, and Layout::forget_letters does so on request 2026-10-23 08:03:27 +00:00
aiongg 0ccb6a9304 keymap: ForeignSet is non_exhaustive and built with ForeignSet::new, with_name and with_truncated 2026-10-23 07:19:55 +00:00
aiongg 315af428c7 keymap: a key whose Latin layout character is no letter runs no letter binding
The suite's egui reports, per key pressed, the character it types on the
Latin layout shortcuts follow (InputState::latin_layout_char). A letter
makes the press that letter; any other character means the key has no
Latin letter, so egui's position fallback no longer turns it into one: on
Dvorak + Russian the key that types й is Dvorak's ', not Ctrl+Q. Without a
report (crates.io egui) the key's position still decides.
2026-10-21 18:05:18 +00:00
aiongg cec769a889 keymap: on layouts that are not Latin, take the letter the toolkit reports
The suite's egui-winit reports a letter key on a layout that is not Latin
as the Latin layout's letter, so on Dvorak + Russian the с key is
Dvorak's J. resolve takes that letter before the key's position; with
crates.io egui the letter is the position, as before.
2026-10-21 17:23:16 +00:00
aiongg 9c75eda598 keymap: block the position fallback only at positions seen typing something else
AZERTY's Ctrl+Shift+E works before an e has been typed.
2026-10-21 05:49:41 +00:00
aiongg d0acf36588 keymap: Shift presses egui reports as their position run nothing on moved layouts
Dvorak's ⇧, types <, which egui has no key for, so egui reports the
press as W and Ctrl+Shift+, ran Ctrl+Shift+W. Once typing shows the
layout's letters are not on QWERTY positions, such a press resolves to
nothing unless the position is known to type its own letter.
2026-10-21 05:47:51 +00:00
aiongg 86248331bb keymap: read presses by the keyboard layout
Matching, the recorder and labels share one rule (craft-libs#198, track 4):
letters by the layout's Latin letter, or by position on layouts that are not
Latin; digits as typed, else by position; punctuation as typed, without the
Shift the layout needs for it. Layout holds whether the layout is Latin and
its characters at punctuation positions, reported by the platform or learned
from typing. KeyInput holds what the toolkit reports for one press, so a
toolkit that knows the virtual-key code, the macOS command table or the
Shift level can pass it on.
2026-10-21 04:57:06 +00:00
aiongg a03f6ab0c3 keymap ui: app errors in the dialog, and the reader's dropped entries
DialogState::show_error shows an app's message under the table until the
user dismisses it (a new Dismiss button on every message) or the next
action replaces it. ForeignSet::truncated carries the entries the app's
reader dropped; plan counts them in ImportReport::truncated, which the
import review shows.
2026-10-20 21:05:56 +00:00
aiongg 636fc8b850 keymap: import-only paths on Bindable
Bindable::import_paths (with_import_path) are read by import matching
like menu paths, and make no areas or groups in the dialog, so a tool's
["Tools", label] path no longer shows a Tools Menu entry.
2026-10-20 20:59:43 +00:00
aiongg 02ba09ee9a keymap ui: Options::visible hides catalog entries from the table
Hidden entries keep their bindings and still count in conflicts; they are
left out of the rows, search and the Show entries.
2026-10-20 20:53:13 +00:00
aiongg d9b1a89950 Merge branch 'craft-keymap' into keymap-ui
# Conflicts:
#	.github/workflows/keymap.yml
#	crates/keymap/README.md
#	crates/keymap/src/egui.rs
2026-10-20 16:01:22 +00:00
aiongg f501cae73b keymap: settle the public API before release
Outcome, ConflictMode, ProfileError and Options are non_exhaustive, with Options::with for
options built in one expression. Profiles keeps its fields private behind active() and sets(),
lists the sets loading dropped in problems(), and stores a format version (a store without one
reads as version 1).
2026-10-20 15:49:51 +00:00
aiongg 501e2cf1fc keymap: while typing, text-editing chords go to the text field unless an active context binds them 2026-10-20 15:21:54 +00:00
aiongg 423524c1bc keymap: clipboard chords with more modifiers run their bindings with clipboard events off 2026-10-20 15:18:05 +00:00
aiongg 5160611bad keymap: while typing, a Ctrl+Alt press runs unless it typed text in the frame 2026-10-20 15:11:46 +00:00
aiongg 339aaa41df keymap: show that an app with sets stores only Profiles and loads the active set 2026-10-20 15:09:14 +00:00
aiongg 0039a5c866 keymap: report Changed after a Cancel that undid edits, so apps rebuild their menus 2026-10-20 15:08:46 +00:00
aiongg cf9e10a90a Merge branch 'craft-keymap' into keymap-ui
# Conflicts:
#	crates/keymap/README.md
#	crates/keymap/src/lib.rs
2026-10-20 03:26:15 +00:00
aiongg 890660444c keymap: use US spelling 2026-10-20 03:24:56 +00:00
aiongg 5e29e70b46 Merge branch 'craft-keymap' into keymap-ui
# Conflicts:
#	crates/keymap/src/egui.rs
2026-10-20 02:42:51 +00:00
aiongg 1b329b9422 keymap: a web clipboard press takes its clipboard event and the pasted text with it 2026-10-20 02:39:41 +00:00
aiongg d0c8d3d0c7 Merge branch 'craft-keymap' into keymap-ui
# Conflicts:
#	crates/keymap/README.md
#	crates/keymap/src/lib.rs
2026-10-19 21:40:28 +00:00
aiongg 86fb06a081 keymap: report Changed after Import when the save prompt changed the set 2026-10-19 20:58:45 +00:00
aiongg 4a721df085 keymap: state that chord reservations are opt-in through with_reserved 2026-10-19 20:47:23 +00:00
aiongg d67d96e9bb keymap: shortcuts dialog right-to-left layout, long-label truncation, pseudo-locale test and README 2026-10-19 12:03:23 +00:00
aiongg 70c84ec76c keymap: named shortcut sets with JSON export and import, and the shortcut editor model
Profiles keeps the user's sets beside the app's built-in ones: switch, duplicate,
rename, delete, export one set as JSON and import it back, and import another
application's set through an import plan as a new set. The editor model holds an
edit session with undo and cancel, conflict queries for steal or keep, a chord
recorder with double press, and search.
2026-10-19 12:03:23 +00:00
aiongg 1e4ab21708 keymap: keep panel-menu entries without keys from clearing commands
The last segment of a panel-menu entry matches alone only when the panel
name is a segment of some catalogue path. An entry without keys matched
only as a panel-menu item leaves the command's shortcuts alone and is
listed in ImportReport::matched_without_change. Tests cover an entry
without keys next to one with keys for the same command, in both orders.
2026-10-19 04:45:45 +00:00
aiongg 6e136c9114 keymap: match panel-menu items, aliases in menus, and Show/Hide only for toggles
- ForeignEntry::in_panel_menu marks an item whose leading segments name a panel
  (InDesign's "Character: All Caps"); it also matches a catalogue path ending
  with its segments, then its last segment as a unique label.
- Aliases count in the menu steps too, joined segments are tried as a label or
  alias anywhere, and normalize_label reads a colon as a space, so the alias
  "Preferences: General…" matches "Edit > Preferences > General...".
- A leading Show, Hide or Show/Hide is dropped only for commands marked
  Bindable::toggle, and only after the names as written found nothing.
- Keys in skipped contexts are left out of unmatched rows, so entries with only
  such keys no longer use up the suggestion cap.
2026-10-19 04:34:27 +00:00
aiongg be51941628 keymap: add Keymap::conflicts_with and document the edit calls
conflicts_with lists the commands that share one command's chords, with
that command as a, without filtering every conflict. The README shows
set_bindings with one binding for an editor with one shortcut per
command; assign adds a binding.
2026-10-19 04:23:26 +00:00
aiongg 5208562c28 keymap: store overrides as a map of one text per command when they fit
Apps that stored { command: text } before read the field in older builds
again. Overrides with several bindings for a command still serialize as
the { command, keys } array. keymap::overrides_list always writes the
array, for craft-settings files, where only an array lets a reset entry
leave the file.
2026-10-19 04:22:49 +00:00
aiongg 4df9e5936a keymap: let apps decline dispatch hits and keep clipboard events
Hit carries the trigger that matched and whether the press matched it
exactly. Dispatcher::dispatch_filtered takes a predicate; a declined hit
leaves its event and text in place.

egui's Copy, Cut and Paste events stay with the app unless
with_clipboard_events(true): egui-winit sends them in place of the
clipboard presses, and a Paste event consumed as a hit lost its text.
With them on, Hit::pasted holds that text, and a web clipboard press
and the event it causes run once for every clipboard chord, not only
Cmd+C/X/V. The Hit doc line moves from DOUBLE_PRESS to Hit.
2026-10-19 04:21:48 +00:00
aiongg d6c7b45350 keymap: shared keyboard bindings, scopes, overrides and shortcut-set import
craft-keymap holds the data and logic for keyboard bindings: egui-free
chords with one canonical text form, bindings to commands with params,
several bindings per command, scopes, tool groups, conflicts, overrides
kept in a craft-settings type, an import pipeline for other applications'
shortcut sets, and an optional egui dispatcher. Apps keep their command
catalogue, file readers and UI.
2026-10-19 03:52:23 +00:00