about summary refs log tree commit diff homepage
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/client.c b/client.c
index 40b52e0..d48ba17 100644
--- a/client.c
+++ b/client.c
@@ -282,10 +282,12 @@ static struct {
 		ModeDraw,
 		ModeLine,
 	} mode;
+	int8_t delta;
 	uint8_t color;
 	uint8_t shift;
 	uint8_t draw;
 } input = {
+	.delta = 1,
 	.color = ColorWhite,
 };
 
@@ -380,10 +382,10 @@ static uint8_t inputCell(wchar_t ch) {
 static void inputNormal(bool keyCode, wchar_t ch) {
 	if (keyCode) {
 		switch (ch) {
-			break; case KEY_LEFT:  clientMove(-1,  0);
-			break; case KEY_RIGHT: clientMove( 1,  0);
-			break; case KEY_UP:    clientMove( 0, -1);
-			break; case KEY_DOWN:  clientMove( 0,  1);
+			break; case KEY_LEFT:  clientMove(-input.delta,  0);
+			break; case KEY_RIGHT: clientMove( input.delta,  0);
+			break; case KEY_UP:    clientMove( 0, -input.delta);
+			break; case KEY_DOWN:  clientMove( 0,  input.delta);
 
 			break; case KEY_F(1): input.shift = 0x00;
 			break; case KEY_F(2): input.shift = 0xC0;
@@ -400,14 +402,16 @@ static void inputNormal(bool keyCode, wchar_t ch) {
 		break; case Esc: modeNormal(); input.shift = 0;
 		break; case 'q': endwin(); exit(EX_OK);
 
-		break; case 'h': clientMove(-1,  0);
-		break; case 'l': clientMove( 1,  0);
-		break; case 'k': clientMove( 0, -1);
-		break; case 'j': clientMove( 0,  1);
-		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 '\\': input.delta = (input.delta == 1 ? 4 : 1);
+
+		break; case 'h': clientMove(-input.delta,  0);
+		break; case 'l': clientMove( input.delta,  0);
+		break; case 'k': clientMove( 0, -input.delta);
+		break; case 'j': clientMove( 0,  input.delta);
+		break; case 'y': clientMove(-input.delta, -input.delta);
+		break; case 'u': clientMove( input.delta, -input.delta);
+		break; case 'b': clientMove(-input.delta,  input.delta);
+		break; case 'n': clientMove( input.delta,  input.delta);
 
 		break; case '0': colorFg(ColorBlack);
 		break; case '1': colorFg(ColorRed);
ass='decoration'> 1.2June McEnroe 2021-02-01Remove use of "%n"June McEnroe https://cvsweb.openbsd.org/src/lib/libc/stdio/vfprintf.c?rev=1.79&content-type=text/x-cvsweb-markup I think this is silly, as I've said elsewhere, and it's a shame because that was clearly the best way to write this. Oh well. 2021-02-01Check signals first in the loopJune McEnroe Signals need to be checked first in the loop to catch any that were delivered between setting up the signals handlers and entering the loop, i.e. in the time it takes to initially start each of the services. 2020-12-15Log a message when stopping a service waiting to restart 1.1June McEnroe It's a little annoying to have to special-case this, but otherwise there is no confirmation in the log that the restart won't still happen. 2020-11-10Refactor unveil calls so errors can be reported properlyJune McEnroe 2020-10-27Do not increment signalsJune McEnroe No need to do a read and a write... and it's declared volatile so maybe that's even worse? I don't even know, but there's no point. 2020-10-23Only look up group if one is namedJune McEnroe 2020-10-23Remove default defines of RUNDIR, ETCDIRJune McEnroe 2020-10-23Set shell scripts executable in buildJune McEnroe 2020-10-20Humanize milliseconds if interval is less than 1sJune McEnroe The intervals are configurable in milliseconds so humanize should be able to display at that precision. 2020-10-20Humanize restart intervalJune McEnroe 2020-08-17Document default catsit.conf location on OpenBSD 1.0June McEnroe 2020-08-17Template catsit script with RUNDIRJune McEnroe 2020-08-17Clean up includesJune McEnroe 2020-08-17Log service uptime in statusJune McEnroe