diff options
author | todd | 2007-11-13 23:08:49 +0000 |
---|---|---|
committer | todd | 2007-11-13 23:08:49 +0000 |
commit | c641c916398e9b9368c59ef7052d88ba40c9ee5f (patch) | |
tree | 8b607e6be0124c9acdefd527afd0a5eab66616fb /kbfunc.c | |
parent | f53c46c25991a5bc2b29f1a3a2469e1e1b446a4d (diff) | |
download | cwm-c641c916398e9b9368c59ef7052d88ba40c9ee5f.tar.gz |
enable pointer movement in cwm via C-<arrowkeys>
looked over by oga@
Diffstat (limited to 'kbfunc.c')
-rw-r--r-- | kbfunc.c | 40 |
1 files changed, 39 insertions, 1 deletions
@@ -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; |