summaryrefslogtreecommitdiffhomepage
path: root/logic
diff options
context:
space:
mode:
Diffstat (limited to 'logic')
-rw-r--r--logic/CMakeLists.txt6
-rw-r--r--logic/shortcuts.cpp26
-rw-r--r--logic/win32-shortcuts.cpp16
-rw-r--r--logic/work.cpp8
4 files changed, 34 insertions, 22 deletions
diff --git a/logic/CMakeLists.txt b/logic/CMakeLists.txt
index f3f128af..f3344798 100644
--- a/logic/CMakeLists.txt
+++ b/logic/CMakeLists.txt
@@ -1,7 +1,7 @@
otr_module(logic BIN)
-target_link_libraries(opentrack-logic opentrack-spline)
+target_link_libraries(${self} opentrack-spline)
if(NOT WIN32)
- target_link_libraries(opentrack-logic opentrack-qxt-mini)
+ target_link_libraries(${self} opentrack-qxt-mini)
else()
- target_link_libraries(opentrack-logic opentrack-dinput winmm)
+ target_link_libraries(${self} opentrack-dinput winmm)
endif()
diff --git a/logic/shortcuts.cpp b/logic/shortcuts.cpp
index 377fa3e5..26465101 100644
--- a/logic/shortcuts.cpp
+++ b/logic/shortcuts.cpp
@@ -83,26 +83,28 @@ void Shortcuts::bind_shortcut(K& key, const key_opts& k, bool held)
#ifdef _WIN32
-void Shortcuts::receiver(const Key& k)
+void Shortcuts::receiver(const Key& key)
{
const unsigned sz = keys.size();
for (unsigned i = 0; i < sz; i++)
{
- K& k_ = std::get<0>(keys[i]);
- if (k.guid != k_.guid)
+ K& k = std::get<0>(keys[i]);
+ if (key.guid != k.guid)
continue;
- if (k.keycode != k_.keycode)
- continue;
-
- if (k_.held && !k.held) continue;
- if (k_.alt != k.alt) continue;
- if (k_.ctrl != k.ctrl) continue;
- if (k_.shift != k.shift) continue;
- if (!k_.should_process())
+ if (key.keycode != k.keycode)
continue;
+ if (k.held && !key.held) continue;
+ if (key.held)
+ {
+ if (k.alt != key.alt) continue;
+ if (k.ctrl != key.ctrl) continue;
+ if (k.shift != key.shift) continue;
+ if (!k.should_process())
+ continue;
+ }
fun& f = std::get<1>(keys[i]);
- f(k.held);
+ f(key.held);
}
}
diff --git a/logic/win32-shortcuts.cpp b/logic/win32-shortcuts.cpp
index c2920071..086c8d92 100644
--- a/logic/win32-shortcuts.cpp
+++ b/logic/win32-shortcuts.cpp
@@ -74,7 +74,21 @@ static const win_key windows_key_sequences[] {
{ DIK_F9, Qt::Key_F9 },
{ DIK_F10, Qt::Key_F10 },
{ DIK_F11, Qt::Key_F11 },
- { DIK_F12, Qt::Key_F12 },
+ { DIK_F13, Qt::Key_F12 },
+ { DIK_F14, Qt::Key_F12 },
+ { DIK_F15, Qt::Key_F12 },
+ { 0x67, Qt::Key_F12 },
+ { 0x68, Qt::Key_F13 },
+ { 0x69, Qt::Key_F14 },
+ { 0x6a, Qt::Key_F15 },
+ { 0x6b, Qt::Key_F16 },
+ { 0x6c, Qt::Key_F17 },
+ { 0x6d, Qt::Key_F18 },
+ { 0x6e, Qt::Key_F19 },
+ { 0x70, Qt::Key_F20 },
+ { 0x71, Qt::Key_F21 },
+ { 0x72, Qt::Key_F23 },
+ { 0x73, Qt::Key_F24 },
{ DIK_0, Qt::Key_0 },
{ DIK_1, Qt::Key_1 },
{ DIK_2, Qt::Key_2 },
diff --git a/logic/work.cpp b/logic/work.cpp
index 302414b8..7689f916 100644
--- a/logic/work.cpp
+++ b/logic/work.cpp
@@ -36,12 +36,8 @@ std::unique_ptr<TrackLogger> Work::make_logger(main_settings &s)
if (s.tracklogging_enabled)
{
QString filename = browse_datalogging_file(s);
- if (filename.isEmpty())
- {
- // The user probably canceled the file dialog. In this case we don't want to do anything.
- return {};
- }
- else
+
+ if (!filename.isEmpty())
{
auto logger = std::make_unique<TrackLoggerCSV>(*s.tracklogging_filename);