diff options
author | Todd T. Fries <todd@cvs.openbsd.org> | 2007-11-13 23:08:50 +0000 |
---|---|---|
committer | Todd T. Fries <todd@cvs.openbsd.org> | 2007-11-13 23:08:50 +0000 |
commit | 435bb8cda7945ef81e6d89245974dea34b7cac67 (patch) | |
tree | dd77eee0f31f61c162d7f1b561b4fbc034dff597 /app/cwm/kbfunc.c | |
parent | 1e970bb479656506de3fc9a252256ca1273f5cfb (diff) |
enable pointer movement in cwm via C-<arrowkeys>
looked over by oga@
Diffstat (limited to 'app/cwm/kbfunc.c')
-rw-r--r-- | app/cwm/kbfunc.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index 923e00c65..b748f605f 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/kbfunc.c @@ -4,7 +4,7 @@ * Copyright (c) 2004 Martin Murray <mmurray@monkey.org> * All rights reserved. * - * $Id: kbfunc.c,v 1.9 2007/11/07 22:02:04 oga Exp $ + * $Id: kbfunc.c,v 1.10 2007/11/13 23:08:49 todd Exp $ */ #include <paths.h> @@ -113,6 +113,44 @@ kbfunc_client_resize(struct client_ctx *cc, void *arg) } void +kbfunc_ptrmove(struct client_ctx *cc, void *arg) +{ + int px,py,mx,my,flags,amt; + struct screen_ctx *sc = screen_current(); + my = mx = 0; + + flags = (int)arg; + amt = MOVE_AMOUNT; + + if (flags & CWM_BIGMOVE) { + flags -= CWM_BIGMOVE; + amt = amt * 10; + } + switch(flags) { + case CWM_UP: + my -= amt; + break; + case CWM_DOWN: + my += amt; + break; + case CWM_RIGHT: + mx += amt; + break; + case CWM_LEFT: + mx -= amt; + break; + } + + if (cc) { + xu_ptr_getpos(cc->pwin, &px, &py); + xu_ptr_setpos(cc->pwin, px + mx, py + my); + } else { + xu_ptr_getpos(sc->rootwin, &px, &py); + xu_ptr_setpos(sc->rootwin, px + mx, py + my); + } +} + +void kbfunc_client_search(struct client_ctx *scratch, void *arg) { struct menu_q menuq; |