diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-09-16 02:49:41 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-09-16 02:49:41 +0200 |
commit | 92d3ff842606576887a4d606995c5ac1bf763f43 (patch) | |
tree | b406897aeafb6c5e9deba8d930a92741f0f28bc7 /sys/src | |
parent | 5cabb3070c7dbbdce439a3b4ddca4720169eafe7 (diff) |
rio: single line scroll up/down with holding shift key
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/cmd/rio/dat.h | 1 | ||||
-rw-r--r-- | sys/src/cmd/rio/rio.c | 2 | ||||
-rw-r--r-- | sys/src/cmd/rio/wind.c | 4 |
3 files changed, 5 insertions, 2 deletions
diff --git a/sys/src/cmd/rio/dat.h b/sys/src/cmd/rio/dat.h index 3d4193d40..17d0747ae 100644 --- a/sys/src/cmd/rio/dat.h +++ b/sys/src/cmd/rio/dat.h @@ -343,3 +343,4 @@ int errorshouldabort; int menuing; /* menu action is pending; waiting for window to be indicated */ int snarfversion; /* updated each time it is written */ int messagesize; /* negotiated in 9P version setup */ +int shiftdown; diff --git a/sys/src/cmd/rio/rio.c b/sys/src/cmd/rio/rio.c index 2300563a0..9c8ea3f9c 100644 --- a/sys/src/cmd/rio/rio.c +++ b/sys/src/cmd/rio/rio.c @@ -345,6 +345,8 @@ keyboardthread(void*) threadsetname("keyboardthread"); while(s = recvp(kbdchan)){ + if(*s == 'k' || *s == 'K') + shiftdown = utfrune(s+1, Kshift) != nil; if(input == nil || sendp(input->ck, s) <= 0) free(s); } diff --git a/sys/src/cmd/rio/wind.c b/sys/src/cmd/rio/wind.c index 2ebafd05f..b9c56ab6e 100644 --- a/sys/src/cmd/rio/wind.c +++ b/sys/src/cmd/rio/wind.c @@ -618,7 +618,7 @@ wkeyctl(Window *w, Rune r) if(!w->mouseopen) switch(r){ case Kdown: - n = w->maxlines/3; + n = shiftdown ? 1 : w->maxlines/3; goto case_Down; case Kscrollonedown: n = mousescrollsize(w->maxlines); @@ -632,7 +632,7 @@ wkeyctl(Window *w, Rune r) wsetorigin(w, q0, TRUE); return; case Kup: - n = w->maxlines/3; + n = shiftdown ? 1 : w->maxlines/3; goto case_Up; case Kscrolloneup: n = mousescrollsize(w->maxlines); |