mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-05 04:56:10 +00:00
Mouse is supported for " widget (#14599)
This commit is contained in:
parent
a970be3c9d
commit
a1c844d6eb
@ -5256,13 +5256,28 @@ void __create_almighty(RCore *core, RPanel *panel, Sdb *menu_db) {
|
||||
const int y = (core->panels->can->h - h) / 2;
|
||||
RModal *modal = __init_modal ();
|
||||
__set_geometry (&modal->pos, x, y, w, h);
|
||||
int okey, key;
|
||||
int okey, key, cx, cy;
|
||||
char *word = NULL;
|
||||
__update_modal (core, menu_db, modal);
|
||||
while (modal) {
|
||||
okey = r_cons_readchar ();
|
||||
key = r_cons_arrow_to_hjkl (okey);
|
||||
if (key == 0 || key == INT8_MAX) {
|
||||
key = 'q';
|
||||
word = NULL;
|
||||
if (r_cons_get_click (&cx, &cy)) {
|
||||
if ((key == 0 || key == INT8_MAX) &&
|
||||
((cx < x || x + w < cx) ||
|
||||
((cy < y || y + h < cy)))) {
|
||||
key = 'q';
|
||||
} else {
|
||||
word = get_word_from_canvas_for_menu (core, core->panels, cx, cy);
|
||||
if (word) {
|
||||
void *cb = sdb_ptr_get (menu_db, word, 0);
|
||||
if (cb) {
|
||||
((RPanelAlmightyCallback)cb) (core, panel, NONE, word);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (key) {
|
||||
case 'j':
|
||||
|
Loading…
x
Reference in New Issue
Block a user