aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO5
-rw-r--r--tools/gsr-global-hotkeys/keyboard_event.c9
2 files changed, 8 insertions, 6 deletions
diff --git a/TODO b/TODO
index 65addf3..3bbaeaa 100644
--- a/TODO
+++ b/TODO
@@ -139,4 +139,7 @@ Add a hotkey to record/stream/replay region.
Do xi grab for keys as well. Otherwise the ui cant be used for keyboard input if a program has grabbed the keyboard, and there could possibly be a game that grabs the keyboard as well.
-Make inactive buttons gray (in dropdown boxes and in the front page with save, etc when replay is not running). \ No newline at end of file
+Make inactive buttons gray (in dropdown boxes and in the front page with save, etc when replay is not running).
+
+Implement focused monitor capture. On nvidia x11 just use the x11 monitor name. On wayland get monitor name from drm cursor. We can get x11 monitor by combining all drm monitors together (with either x11 or wayland monitor position info) and then calculating the x11 monitor at that position.
+ To get the drm monitor from x11 cursor we can get the x11 monitor then get the CONNECTOR_ID property and get the monitor that matches that. Then copy the drm monitor name code from gsr and use that in gsr-ui to get the same name to use as monitor. \ No newline at end of file
diff --git a/tools/gsr-global-hotkeys/keyboard_event.c b/tools/gsr-global-hotkeys/keyboard_event.c
index c2bd75a..9a92b56 100644
--- a/tools/gsr-global-hotkeys/keyboard_event.c
+++ b/tools/gsr-global-hotkeys/keyboard_event.c
@@ -120,14 +120,13 @@ static void keyboard_event_process_key_state_change(keyboard_event *self, const
/* Return true if a global hotkey is assigned to the key combination */
static bool keyboard_event_on_key_pressed(keyboard_event *self, const struct input_event *event, uint32_t modifiers) {
- if(event->value != KEYBOARD_BUTTON_PRESSED)
- return false;
-
bool global_hotkey_match = false;
for(int i = 0; i < self->num_global_hotkeys; ++i) {
if(event->code == self->global_hotkeys[i].key && modifiers == self->global_hotkeys[i].modifiers) {
- puts(self->global_hotkeys[i].action);
- fflush(stdout);
+ if(event->value == KEYBOARD_BUTTON_PRESSED) {
+ puts(self->global_hotkeys[i].action);
+ fflush(stdout);
+ }
global_hotkey_match = true;
}
}