summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 43103df)
raw | patch | inline | side by side (parent: 43103df)
author | Max Kellermann <max.kellermann@gmail.com> | |
Mon, 20 Mar 2017 11:02:33 +0000 (12:02 +0100) | ||
committer | Max Kellermann <max.kellermann@gmail.com> | |
Mon, 20 Mar 2017 11:10:19 +0000 (12:10 +0100) |
src/command.c | patch | blob | history | |
src/command.h | patch | blob | history | |
src/keyboard.c | patch | blob | history | |
src/keyboard.h | patch | blob | history | |
src/screen_find.c | patch | blob | history |
diff --git a/src/command.c b/src/command.c
index 889ef0ddff95be93d7bb2317ff612b3267a62f76..f903165f57a113034df735373395a4a5a3d43a7f 100644 (file)
--- a/src/command.c
+++ b/src/command.c
return find_key_command(key, cmds);
}
-command_t
-get_keyboard_command(void)
-{
- int key = wgetch(stdscr);
- if (key == ERR || key == '\0')
- return CMD_NONE;
-
-#ifdef HAVE_GETMOUSE
- if (key == KEY_MOUSE)
- return CMD_MOUSE_EVENT;
-#endif
-
- return get_key_command(key);
-}
-
bool
assign_keys(command_t command, int keys[MAX_COMMAND_KEYS])
{
diff --git a/src/command.h b/src/command.h
index 3545214607f8b382c9e6a687267f7bce3905a697..1d6b6babcf8721b02ed1f97a0017d368bab2ba18 100644 (file)
--- a/src/command.h
+++ b/src/command.h
bool
assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]);
-command_t get_keyboard_command(void);
-
#endif
diff --git a/src/keyboard.c b/src/keyboard.c
index 5bd43e573ab3e173b26542ccbf676418068cf778..80a1eeeae16f41e199fa11dab8cb73ba8216ecd9 100644 (file)
--- a/src/keyboard.c
+++ b/src/keyboard.c
#include "keyboard.h"
#include "command.h"
#include "ncmpc.h"
+#include "ncmpc_curses.h"
#include "Compiler.h"
#include <glib.h>
#include <unistd.h>
+command_t
+get_keyboard_command(void)
+{
+ int key = wgetch(stdscr);
+ if (key == ERR || key == '\0')
+ return CMD_NONE;
+
+#ifdef HAVE_GETMOUSE
+ if (key == KEY_MOUSE)
+ return CMD_MOUSE_EVENT;
+#endif
+
+ return get_key_command(key);
+}
+
static gboolean
keyboard_event(gcc_unused GIOChannel *source,
gcc_unused GIOCondition condition,
diff --git a/src/keyboard.h b/src/keyboard.h
index dfafa92fc64c7f449c087bc8cd965cb5fdd2f10a..ea888e5244a9983d7dce69ff558206b4c135b1b8 100644 (file)
--- a/src/keyboard.h
+++ b/src/keyboard.h
#ifndef KEYBOARD_H
#define KEYBOARD_H
+#include "command.h"
+
void
keyboard_init(void);
+command_t
+get_keyboard_command(void);
+
#endif
diff --git a/src/screen_find.c b/src/screen_find.c
index 06365b50e53c5bdbd9cad2aea37ab7db9922ef3f..2427801274c5cbdb2c32854474689e228ac18cd4 100644 (file)
--- a/src/screen_find.c
+++ b/src/screen_find.c
#include "screen_utils.h"
#include "screen_status.h"
#include "screen.h"
+#include "keyboard.h"
#include "i18n.h"
#include "options.h"
#include "ncmpc.h"