Support movement by key
This commit is contained in:
parent
b4c6cb70b6
commit
ebf640520e
|
@ -196,6 +196,33 @@ export component MainTab inherits Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FocusScope {
|
||||||
|
key-pressed(event) => {
|
||||||
|
if(vram_files_list.current-item != -1) {
|
||||||
|
if(event.text == Key.LeftArrow) {
|
||||||
|
root.move_vram_image(vram_files_list.current-item, -1, 0);
|
||||||
|
cur_sel_x.text = vram_images[vram_files_list.current-item].x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(event.text == Key.RightArrow) {
|
||||||
|
root.move_vram_image(vram_files_list.current-item, 1, 0);
|
||||||
|
cur_sel_x.text = vram_images[vram_files_list.current-item].x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(event.text == Key.UpArrow) {
|
||||||
|
root.move_vram_image(vram_files_list.current-item, 0, -1);
|
||||||
|
cur_sel_y.text = vram_images[vram_files_list.current-item].y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(event.text == Key.DownArrow) {
|
||||||
|
root.move_vram_image(vram_files_list.current-item, 0, 1);
|
||||||
|
cur_sel_y.text = vram_images[vram_files_list.current-item].y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
accept
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function get_border_width() -> int {
|
function get_border_width() -> int {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue