Skip to content

Commit

Permalink
I think I found a sweet spot for key repeat delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Tietz committed Aug 29, 2022
1 parent 52a5be6 commit 5adec1b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ To enter command mode press escape.
commands:
- exit => exits the program
- resume => exits command mode
- restart => restarts the game
- nanosleep secs nanos => configures nanosleep after every cycle (I am aware that this is not a great solution)
- remap key to => first parameter is key-pressed and second parameter the hex value of the mapping
- view setting => view value of specified setting
Expand Down
2 changes: 1 addition & 1 deletion chip8.zig
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ fn commandMode(
}

fn enterRawMode(allocator: Allocator) linux.termios {
_ = std.ChildProcess.exec(.{.allocator=allocator, .argv=&[_][]const u8{"xset", "r", "rate", "50"}}) catch {};
_ = std.ChildProcess.exec(.{.allocator=allocator, .argv=&[_][]const u8{"xset", "r", "rate", "100"}}) catch {};
var tty_attr: linux.termios = undefined;
_ = linux.tcgetattr(linux.STDIN_FILENO, &tty_attr);
const tty_attr_bak = tty_attr;
Expand Down
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
}
},
"invaders": {
"sleep_nanos": 1044166,
"keymap": {
"a": "4",
"d": "6"
Expand Down

0 comments on commit 5adec1b

Please sign in to comment.