if (key == get_action_key(world.keybindings, "quit"))
break;
else if (key == get_action_key(world.keybindings, "scroll pad right"))
- win_meta.pad_offset++;
- else if (key == get_action_key(world.keybindings, "scroll pad left") && win_meta.pad_offset > 0)
- win_meta.pad_offset--;
+ scroll_pad (&win_meta, '+');
+ else if (key == get_action_key(world.keybindings, "scroll pad left"))
+ scroll_pad (&win_meta, '-');
else if (key == get_action_key(world.keybindings, "toggle keys window"))
toggle_window(&win_meta, &win_keys);
else if (key == get_action_key(world.keybindings, "toggle map window"))
win_meta.pad = newpad(win_meta.height, 1);
return win_meta; }
+void scroll_pad (struct WinMeta * win_meta, char dir) {
+// Scroll pad left (if possible) or right.
+ if ('+' == dir)
+ win_meta->pad_offset++;
+ else if ('-' == dir && win_meta->pad_offset > 0)
+ win_meta->pad_offset--; }
+
struct Win init_window (struct WinMeta * win_meta, char * title) {
// Create and populate Win struct with sane default values.
struct Win win;
struct yx br; };
struct WinMeta init_win_meta (WINDOW *);
+void scroll_pad (struct WinMeta *, char);
struct Win init_window (struct WinMeta *, char *);
void append_window (struct WinMeta *, struct Win *);
void suspend_window (struct WinMeta *, struct Win *);