From 17c4d5ae4bec1904c57df666c19b427e580eed57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Sat, 24 Feb 2018 22:28:30 +0100 Subject: [PATCH] Notes keybinding system --- notes.org | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/notes.org b/notes.org index 43b1e00..2240bbb 100644 --- a/notes.org +++ b/notes.org @@ -46,7 +46,24 @@ The Keybinding object which is supplied to keyhandler doesn't seem to expose the Simply use the keysym name as if the modifier was a regular key. Don't use angle brackets - those are used for **modifiers**. : settings.set_strv("my-action", ["Super_L"]) ** Bind keys without using actions from a schema -https://stackoverflow.com/a/42466781/1517969 +From: https://stackoverflow.com/a/42466781/1517969 + +#+BEGIN_SRC javascript +Meta = imports.gi.Meta; +Main = imports.ui.main; +Shell = imports.gi.Shell; + +let action = global.display.grab_accelerator("u"); +let name = Meta.external_binding_name_for_action(action); +Main.wm.allowKeybinding(name, Shell.ActionMode.ALL); +global.display.connect( + 'accelerator-activated', + function(display, action, deviceId, timestamp){ + log('Accelerator Activated: [display={}, action={}, deviceId={}, timestamp={}]', + display, action, deviceId, timestamp) + }) +#+END_SRC + * Stack level There's not enough room for a maximized window to slide above another maximized window if they move at the same speed: