From 9fc1e934cd2c58ed1ba03f860b09e7a8cd48e792 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 13 Apr 2025 23:00:54 +0530 Subject: Add support for number keys and open view by number key --- src/keymap/KeySeqParser.cpp | 5 ++++- src/widgets/BrowserApp.cpp | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/keymap/KeySeqParser.cpp b/src/keymap/KeySeqParser.cpp index aef3b58..555e955 100644 --- a/src/keymap/KeySeqParser.cpp +++ b/src/keymap/KeySeqParser.cpp @@ -57,7 +57,10 @@ Qt::Key KeySeqParser::parse_key(const QString &key_name) { if (key_name.length() == 1) { const char key_char = key_name.toStdString().at(0); - return Qt::Key(Qt::Key_A + (key_char - 'a')); + if (key_char >= 'a' && key_char <= 'z') + return Qt::Key(Qt::Key_A + (key_char - 'a')); + if (key_char >= '0' && key_char <= '9') + return Qt::Key(Qt::Key_0 + (key_char - '0')); } if (key_name == "space") diff --git a/src/widgets/BrowserApp.cpp b/src/widgets/BrowserApp.cpp index 9b65b3a..502d930 100644 --- a/src/widgets/BrowserApp.cpp +++ b/src/widgets/BrowserApp.cpp @@ -21,7 +21,6 @@ BrowserApp::BrowserApp() { lua.load_file_sync("./config.lua"); // Initializes profile - QList profiles{&default_profile}; for (auto *profile : profiles) { profile->setDownloadPath(configuration.downloads_dir()); profile->setHttpUserAgent(configuration.user_agent()); -- cgit v1.3.1