feat: keyboard and mouse shortcut overview window
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
3e0d0de325
commit
018b98eddf
6 files changed
+248
-3
No files matched your search
@@ -0,0 +1,52 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
|
||||
namespace udpscope {
|
||||
|
||||
/// Everything a key can ask the application to do. The plot's own actions (zoom, pan, fit)
|
||||
/// are not here: they belong to the plotter's input controller, which handles its own keys.
|
||||
enum class AppAction {
|
||||
PauseToggle,
|
||||
TriggerArm,
|
||||
TriggerPanel,
|
||||
CursorsPane,
|
||||
MeasuresPane,
|
||||
MathPane,
|
||||
LayoutEditor,
|
||||
SidePanel,
|
||||
Export,
|
||||
Help,
|
||||
Shortcuts,
|
||||
Quit,
|
||||
};
|
||||
|
||||
/// One application accelerator: what to press, what it does, and where the overview lists it.
|
||||
struct Accel {
|
||||
unsigned keyval; ///< GDK keyval
|
||||
unsigned mods; ///< GdkModifierType mask, 0 for a bare key
|
||||
AppAction action;
|
||||
const char* accel_text; ///< what the overview prints
|
||||
const char* description;
|
||||
const char* section;
|
||||
};
|
||||
|
||||
/// One documented plot interaction. These have no AppAction: the plotter's own controller
|
||||
/// implements them, and this table exists so the overview can list them.
|
||||
struct Gesture {
|
||||
const char* accel_text;
|
||||
const char* description;
|
||||
const char* section;
|
||||
};
|
||||
|
||||
/// The application accelerator table. Writes the row count to `count`.
|
||||
const Accel* app_accels(int* count);
|
||||
|
||||
/// The plot keyboard and mouse table. Writes the row count to `count`.
|
||||
const Gesture* plot_gestures(int* count);
|
||||
|
||||
/// The accelerator for `keyval` with `mods`, or nullptr. `mods` is masked to
|
||||
/// Ctrl/Shift/Alt before comparing, because Lock, Num-Lock and the pointer buttons
|
||||
/// arrive in the same mask and would otherwise never match a table row.
|
||||
const Accel* find_accel(unsigned keyval, unsigned mods);
|
||||
|
||||
} // namespace udpscope
|
||||
Reference in new issue
Block a user