diff options
author | sabetts <sabetts> | 2002-11-20 09:06:12 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2002-11-20 09:06:12 +0000 |
commit | 94c5b929a7c3e0f84499210b97093a3015151100 (patch) | |
tree | aa936e07612be6b858709ea6242e610e7c2ba58f /src/actions.c | |
parent | c2ffdb2c8f4bb27811cda997371732967321cb82 (diff) | |
download | ratpoison-94c5b929a7c3e0f84499210b97093a3015151100.zip |
* src/main.c (init_defaults): set pointer warping to on by
default.
* src/list.c (give_window_focus): only warp the pointer if the
warp setting is turned on.
* src/data.h (struct rp_defaults): new member, warp.
* src/actions.h (cmd_ward): new prototype
* src/actions.c (user_command): new command "warp"
(cmd_warp): new function
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/actions.c b/src/actions.c index 579d2ad..61c785c 100644 --- a/src/actions.c +++ b/src/actions.c @@ -86,6 +86,7 @@ static user_command user_commands[] = {"unalias", cmd_unalias, arg_STRING}, {"prevscreen", cmd_prevscreen, arg_VOID}, {"nextscreen", cmd_nextscreen, arg_VOID}, + {"warp", cmd_warp, arg_STRING}, /*@end (tag required for genrpbindings) */ /* Commands to set default behavior. */ @@ -2571,3 +2572,25 @@ cmd_prevscreen (int interactive, void *data) return NULL; } + +char * +cmd_warp (int interactive, void *data) +{ + if (data == NULL && !interactive) + return xsprintf ("%s", defaults.warp ? "on":"off"); + + if (data == NULL) + { + message (" warp; one argument required "); + return NULL; + } + + if (!strcasecmp (data, "on")) + defaults.warp = 1; + else if (!strcasecmp (data, "off")) + defaults.warp = 0; + else + message (" warp; Invalid argument "); + + return NULL; +} |