summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <benjaminfranzke@googlemail.com>2010-07-13 16:31:03 +0200
committerben <benjaminfranzke@googlemail.com>2010-07-13 16:31:03 +0200
commit66e647d0254de74ee44535aba4d8e6d99f7031b9 (patch)
tree8be0056f67fd4cf5e4e2fe7c26ff2f1889f55108
parent803b7b24229c42cd9d5eee8c1da166382a321d5c (diff)
downloadpa-sink-ctl-66e647d0254de74ee44535aba4d8e6d99f7031b9.tar.gz
pa-sink-ctl-66e647d0254de74ee44535aba4d8e6d99f7031b9.tar.bz2
pa-sink-ctl-66e647d0254de74ee44535aba4d8e6d99f7031b9.zip
add vim-like (hjkl) shortcuts
-rw-r--r--src/interface.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/interface.c b/src/interface.c
index f46f6dc..dd00c0e 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -152,6 +152,7 @@ void get_input(void)
int volume_mult = 0;
switch (c) {
+ case 'k':
case KEY_UP:
if (chooser_input == -1 && chooser_sink > 0) {
--chooser_sink;
@@ -162,6 +163,7 @@ void get_input(void)
--chooser_input;
break;
+ case 'j':
case KEY_DOWN:
if (chooser_input == sink_list[chooser_sink]->input_counter - 1 && chooser_sink < sink_counter - 1) {
++chooser_sink;
@@ -171,8 +173,10 @@ void get_input(void)
++chooser_input;
break;
+ case 'h':
case KEY_LEFT:
volume_mult = -1;
+ case 'l':
case KEY_RIGHT:
if (volume_mult == 0)
volume_mult = 1;
@@ -197,7 +201,8 @@ void get_input(void)
return;
break;
- case 32:
+ case '\n':
+ case ' ':
if (chooser_input == -1)
break;
selected_index = sink_list[chooser_sink]->input_list[chooser_input]->index;
@@ -217,6 +222,7 @@ void get_input(void)
return;
break;
+ case 'q':
default:
printf("key: %d\n", c);
quit();