command/input: add map-to-output

This commit is contained in:
LordMZTE
2024-02-20 21:54:06 +01:00
committed by Isaac Freund
parent 95da9b5875
commit 0cb7c49cc3
9 changed files with 92 additions and 18 deletions

View File

@ -112,19 +112,7 @@ pub fn input(
// add an input configuration at an arbitrary position in the generality
// ordered list, so the simplest way to ensure the device is configured
// correctly is to apply all input configurations again, in order.
var it = server.input_manager.devices.iterator(.forward);
while (it.next()) |device| {
// Device does not match the glob given in the command, so its
// configuration state after applying all configs again would be
// the same.
if (!globber.match(device.identifier, args[1])) continue;
for (server.input_manager.configs.items) |config| {
if (globber.match(device.identifier, config.glob)) {
config.apply(device);
}
}
}
server.input_manager.reconfigureDevices();
}
fn lessThan(_: void, a: InputConfig, b: InputConfig) bool {