summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2017-07-31 00:32:04 -0400
committerJune McEnroe <june@causal.agency>2017-07-31 00:32:04 -0400
commit7ae0b16aec82ae6ae4023bfd23ddef8ba6965b3a (patch)
tree01e1176bbc6f0a799fea753a94ca1579e3f897f3
parentHandle large moves (diff)
downloadtorus-7ae0b16aec82ae6ae4023bfd23ddef8ba6965b3a.tar.gz
torus-7ae0b16aec82ae6ae4023bfd23ddef8ba6965b3a.zip
Adjust move speed in client
-rwxr-xr-xclient.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/client.c b/client.c
index 1e2ea69..72c21c9 100755
--- a/client.c
+++ b/client.c
@@ -104,6 +104,8 @@ static void swapCell(int8_t dx, int8_t dy) {
     clientPut(aColor, aCell);
 }
 
+static int8_t moveSpeed = 1;
+
 static void readInput(void) {
     int c = getch();
 
@@ -168,14 +170,17 @@ static void readInput(void) {
         case 'x': clientPut(CH_COLOR(inch()), ' '); break;
         case '~': clientPut(inputColor, inch() & 0x7F); clientMove(1, 0); break;
 
-        case 'h': clientMove(-1,  0); break;
-        case 'j': clientMove( 0,  1); break;
-        case 'k': clientMove( 0, -1); break;
-        case 'l': clientMove( 1,  0); break;
-        case 'y': clientMove(-1, -1); break;
-        case 'u': clientMove( 1, -1); break;
-        case 'b': clientMove(-1,  1); break;
-        case 'n': clientMove( 1,  1); break;
+        case '[': if (moveSpeed > 1) moveSpeed--; break;
+        case ']': if (moveSpeed < 4) moveSpeed++; break;
+
+        case 'h': clientMove(-moveSpeed,          0); break;
+        case 'j': clientMove(         0,  moveSpeed); break;
+        case 'k': clientMove(         0, -moveSpeed); break;
+        case 'l': clientMove( moveSpeed,          0); break;
+        case 'y': clientMove(-moveSpeed, -moveSpeed); break;
+        case 'u': clientMove( moveSpeed, -moveSpeed); break;
+        case 'b': clientMove(-moveSpeed,  moveSpeed); break;
+        case 'n': clientMove( moveSpeed,  moveSpeed); break;
 
         case 'H': swapCell(-1,  0); break;
         case 'J': swapCell( 0,  1); break;
t/www/causal.agency/torus.pty?id=847d6adeb63bc50413b89853c7eb4a1314ce5ccb&follow=1'>Add new causal.agency with shotty shotsJune McEnroe 2019-07-12Use -s to infer terminal sizeJune McEnroe 2019-07-12Add DCH to shottyJune McEnroe This makes htop mostly work. Scrolling region still missing. 2019-07-12Support insert mode in shottyJune McEnroe This is how curses puts characters into the bottom-right cell of the terminal. 2019-07-11Don't do carriage return on line feedJune McEnroe 2019-07-11Interpret 256color-style SGRsJune McEnroe 2019-07-11Use inline style rather than <b>, <i>, <u>June McEnroe 2019-07-11Factor out clearJune McEnroe 2019-07-11Add bright option to shottyJune McEnroe 2019-07-11Output <b>, <i>, <u> in shottyJune McEnroe 2019-07-10Ignore SM and RMJune McEnroe 2019-07-09Add shotty man page and build itJune McEnroe 2019-07-09Add up -cJune McEnroe 2019-07-09Add options for default colors to shottyJune McEnroe 2019-07-08Use char literals consistentlyJune McEnroe