diff options
Diffstat (limited to 'src/gsr-shortcut-accel-dialog.h')
| -rw-r--r-- | src/gsr-shortcut-accel-dialog.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/gsr-shortcut-accel-dialog.h b/src/gsr-shortcut-accel-dialog.h new file mode 100644 index 0000000..87c3bd3 --- /dev/null +++ b/src/gsr-shortcut-accel-dialog.h @@ -0,0 +1,35 @@ +#pragma once + +/* + * gsr-shortcut-accel-dialog.h — Key capture dialog for hotkey assignment. + * + * Ptyxis-style AdwDialog with GtkEventControllerKey in capture phase. + * Opens in immediate capture mode: user presses key combo, then confirms. + * + * Escape = cancel, Backspace = clear/disable shortcut. + */ + +#include <adwaita.h> + +G_BEGIN_DECLS + +#define GSR_TYPE_SHORTCUT_ACCEL_DIALOG (gsr_shortcut_accel_dialog_get_type()) +G_DECLARE_FINAL_TYPE(GsrShortcutAccelDialog, gsr_shortcut_accel_dialog, + GSR, SHORTCUT_ACCEL_DIALOG, AdwDialog) + +/** + * Create a new shortcut accel dialog. + * @shortcut_title: Human-readable name like "Start/Stop streaming" + * @current_accel: Current accelerator string (e.g. "<Alt>1") or NULL + */ +GsrShortcutAccelDialog *gsr_shortcut_accel_dialog_new(const char *shortcut_title, + const char *current_accel); + +/** + * Get the accelerator string that was captured. + * Returns NULL if the shortcut was cleared (Backspace). + * Returns a borrowed string, valid until the dialog is destroyed. + */ +const char *gsr_shortcut_accel_dialog_get_accelerator(GsrShortcutAccelDialog *self); + +G_END_DECLS |
