Fixed input key bindings.

This commit is contained in:
rakshasa
2025-08-04 09:34:31 +02:00
committed by Jari Sundell
parent 9ac43c2b40
commit 420f03b40b
3 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -26,7 +26,6 @@ ElementDownloadList::ElementDownloadList() {
throw torrent::internal_error("View \"main\" must be present to initialize the main display."); throw torrent::internal_error("View \"main\" must be present to initialize the main display.");
m_bindings['\x13'] = std::bind(&ElementDownloadList::receive_command, this, "d.start="); m_bindings['\x13'] = std::bind(&ElementDownloadList::receive_command, this, "d.start=");
m_bindings[KEY_STOP] = m_bindings[control->ui()->navigation_key(RT_KEY_STOP)] = std::bind(&ElementDownloadList::receive_command, this, "branch=d.state=,d.stop=,d.erase=");
m_bindings['\x0B'] = std::bind(&ElementDownloadList::receive_command, this, "d.ignore_commands.set=1; d.stop=; d.close="); m_bindings['\x0B'] = std::bind(&ElementDownloadList::receive_command, this, "d.ignore_commands.set=1; d.stop=; d.close=");
m_bindings['\x12'] = std::bind(&ElementDownloadList::receive_command, this, "d.complete.set=0; d.check_hash="); m_bindings['\x12'] = std::bind(&ElementDownloadList::receive_command, this, "d.complete.set=0; d.check_hash=");
m_bindings['\x05'] = std::bind(&ElementDownloadList::receive_command, this, "f.multicall=,f.set_create_queued=0,f.set_resize_queued=0; print=\"Queued create/resize of files in torrent.\""); m_bindings['\x05'] = std::bind(&ElementDownloadList::receive_command, this, "f.multicall=,f.set_create_queued=0,f.set_resize_queued=0; print=\"Queued create/resize of files in torrent.\"");
@@ -64,6 +63,7 @@ ElementDownloadList::ElementDownloadList() {
m_bindings[KEY_HOME] = m_bindings[control->ui()->navigation_key(RT_KEY_HOME)] = [this] { receive_home(); }; m_bindings[KEY_HOME] = m_bindings[control->ui()->navigation_key(RT_KEY_HOME)] = [this] { receive_home(); };
m_bindings[KEY_END] = m_bindings[control->ui()->navigation_key(RT_KEY_END)] = [this] { receive_end(); }; m_bindings[KEY_END] = m_bindings[control->ui()->navigation_key(RT_KEY_END)] = [this] { receive_end(); };
m_bindings[control->ui()->navigation_key(RT_KEY_DELETE_ITEM)] = std::bind(&ElementDownloadList::receive_command, this, "branch=d.state=,d.stop=,d.erase=");
m_bindings[control->ui()->navigation_key(RT_KEY_TOGGLE_LAYOUT)] = std::bind(&ElementDownloadList::toggle_layout, this); m_bindings[control->ui()->navigation_key(RT_KEY_TOGGLE_LAYOUT)] = std::bind(&ElementDownloadList::toggle_layout, this);
} }
+8 -8
View File
@@ -32,14 +32,14 @@ static const int emacs_keymap[RT_KEYMAP_MAX] = {
'F' - '@', 'F' - '@',
'P' - '@', 'P' - '@',
'N' - '@', 'N' - '@',
'l',
'k',
'U' - '@', 'U' - '@',
'H' - '@', 'H' - '@',
'A' - '@', 'A' - '@',
'E' - '@', 'E' - '@',
'L', 'D' - '@', // RT_KEY_DELETE_ITEM
'D' - '@' 'k', // RT_KEY_DISCONNECT_PEER
'l', // RT_KEY_DISPLAY_LOG
'L' // RT_KEY_TOGGLE_LAYOUT
}; };
static const int vi_keymap[RT_KEYMAP_MAX] = { static const int vi_keymap[RT_KEYMAP_MAX] = {
@@ -47,14 +47,14 @@ static const int vi_keymap[RT_KEYMAP_MAX] = {
'l', 'l',
'k', 'k',
'j', 'j',
'L',
'K',
'B' - '@', 'B' - '@',
'D' - '@', 'D' - '@',
'H', 'H',
'G', 'G',
'L' - '@', 'x', // RT_KEY_DELETE_ITEM
'x' 'K', // RT_KEY_DISCONNECT_PEER
'L', // RT_KEY_DISPLAY_LOG
'L' - '@' // RT_KEY_TOGGLE_LAYOUT
}; };
Root::Root() { Root::Root() {
+3 -3
View File
@@ -28,14 +28,14 @@ enum NavigationKeymap {
RT_KEY_RIGHT, RT_KEY_RIGHT,
RT_KEY_UP, RT_KEY_UP,
RT_KEY_DOWN, RT_KEY_DOWN,
RT_KEY_DISPLAY_LOG,
RT_KEY_DISCONNECT_PEER,
RT_KEY_PPAGE, RT_KEY_PPAGE,
RT_KEY_NPAGE, RT_KEY_NPAGE,
RT_KEY_HOME, RT_KEY_HOME,
RT_KEY_END, RT_KEY_END,
RT_KEY_DELETE_ITEM,
RT_KEY_DISCONNECT_PEER,
RT_KEY_DISPLAY_LOG,
RT_KEY_TOGGLE_LAYOUT, RT_KEY_TOGGLE_LAYOUT,
RT_KEY_STOP,
RT_KEYMAP_MAX RT_KEYMAP_MAX
}; };