Skip to content

Commit

Permalink
Right click is supported to open " widget ##panels
Browse files Browse the repository at this point in the history
  • Loading branch information
Vane11ope authored and radare committed Jul 17, 2019
1 parent 02aeed0 commit 52c8e46
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 11 additions & 5 deletions libr/cons/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ R_API int r_cons_arrow_to_hjkl(int ch) {
int vn = 0;
do {
ch = r_cons_readchar ();
// just for debugging
//eprintf ( "%c", ch);
if (sc > 0) {
if (ch >= '0'&& ch <= '9') {
if (ch >= '0' && ch <= '9') {
pos[p++] = ch;
}
}
Expand All @@ -166,10 +167,16 @@ R_API int r_cons_arrow_to_hjkl(int ch) {
p = 0;
}
} while (ch != 'M' && ch != 'm');
if (atoi (vel) == 64) {
int nvel = atoi (vel);
switch (nvel) {
case 2: // right click
if (ch == 'M') {
return INT8_MAX;
}
return -INT8_MAX;
case 64: // wheel up
return 'k';
}
if (atoi (vel) == 65) {
case 65: // wheel down
return 'j';
}
pos[p++] = 0;
Expand All @@ -180,7 +187,6 @@ R_API int r_cons_arrow_to_hjkl(int ch) {
}
}
return 0;
break;
case '[':
ch = r_cons_readchar ();
switch (ch) {
Expand Down
6 changes: 6 additions & 0 deletions libr/core/panels.c
Original file line number Diff line number Diff line change
Expand Up @@ -5246,6 +5246,9 @@ void __create_almighty(RCore *core, RPanel *panel, Sdb *menu_db) {
while (modal) {
okey = r_cons_readchar ();
key = r_cons_arrow_to_hjkl (okey);
if (key == 0 || key == INT8_MAX) {
key = 'q';
}
switch (key) {
case 'j':
modal->idx++;
Expand Down Expand Up @@ -5914,6 +5917,9 @@ void __panels_process(RCore *core, RPanels *panels) {
goto repeat;
}
}
if (key == INT8_MAX) {
key = '"';
}
skip:
r_cons_switchbuf (true);

Expand Down

0 comments on commit 52c8e46

Please sign in to comment.