Poll all text from linux global hotkeys instead of once per update

This commit is contained in:
dec05eba
2024-11-24 20:25:31 +01:00
parent 9b363d3c0d
commit b57bc8505d

View File

@@ -89,13 +89,14 @@ namespace gsr {
} }
char buffer[256]; char buffer[256];
while(true) {
char *line = fgets(buffer, sizeof(buffer), read_file); char *line = fgets(buffer, sizeof(buffer), read_file);
if(!line) if(!line)
return; 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';
@@ -105,4 +106,5 @@ namespace gsr {
if(it != bound_actions_by_id.end()) if(it != bound_actions_by_id.end())
it->second(action); it->second(action);
} }
}
} }