When xmp-cli is built & run on Windows (using msys2 + mingw64), the arrow keys do not do anything.
The change below is my attempt to fix it, which seems to work (tested on Windows 10 & 11 with both cmd and Windows Terminal).
Also tested on Ubuntu 24.04 to ensure that it does not break anything there.
diff --git a/src/commands.c b/src/commands.c
index 7673f8d7..9620ab5d 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -148,10 +148,27 @@ void read_command(xmp_context handle, const struct xmp_module_info *mi, struct c
int cmd;
cmd = read_key();
- if (cmd <= 0)
+ if (cmd == -1)
return;
switch (cmd) {
+#ifdef WIN32
+ case 0x00:
+ case -0x20: // 0xe0
+ cmd = read_key();
+ switch (cmd) {
+ case 0x48:
+ goto cmd_next_mod;
+ case 0x50:
+ goto cmd_prev_mod;
+ case 0x4d:
+ goto cmd_next_pos;
+ case 0x4b:
+ goto cmd_prev_pos;
+ }
+
+ break;
+#endif
case 0x1b: /* escape */
cmd = read_key();
if (cmd != '[')
When xmp-cli is built & run on Windows (using msys2 + mingw64), the arrow keys do not do anything.
The change below is my attempt to fix it, which seems to work (tested on Windows 10 & 11 with both cmd and Windows Terminal).
Also tested on Ubuntu 24.04 to ensure that it does not break anything there.