mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Poll all text from linux global hotkeys instead of once per update
This commit is contained in:
@@ -89,20 +89,22 @@ namespace gsr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
char *line = fgets(buffer, sizeof(buffer), read_file);
|
while(true) {
|
||||||
if(!line)
|
char *line = fgets(buffer, sizeof(buffer), read_file);
|
||||||
return;
|
if(!line)
|
||||||
|
break;
|
||||||
|
|
||||||
const int line_len = strlen(line);
|
const int line_len = strlen(line);
|
||||||
if(line_len == 0)
|
if(line_len == 0)
|
||||||
return;
|
continue;
|
||||||
|
|
||||||
if(line[line_len - 1] == '\n')
|
if(line[line_len - 1] == '\n')
|
||||||
line[line_len - 1] = '\0';
|
line[line_len - 1] = '\0';
|
||||||
|
|
||||||
const std::string action = line;
|
const std::string action = line;
|
||||||
auto it = bound_actions_by_id.find(action);
|
auto it = bound_actions_by_id.find(action);
|
||||||
if(it != bound_actions_by_id.end())
|
if(it != bound_actions_by_id.end())
|
||||||
it->second(action);
|
it->second(action);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user