From 95f542365f6f1cd043c7b3090a67d269d6dde58b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 16 Oct 2015 21:38:23 +0200 Subject: allow for filter immediate center --- opentrack/plugin-api.hpp | 2 ++ opentrack/tracker.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'opentrack') diff --git a/opentrack/plugin-api.hpp b/opentrack/plugin-api.hpp index 732dbb3d..a57077ab 100644 --- a/opentrack/plugin-api.hpp +++ b/opentrack/plugin-api.hpp @@ -61,6 +61,8 @@ struct IFilter // perform filtering step. // you have to take care of dt on your own, try "opentrack-compat/timer.hpp" virtual void filter(const double *input, double *output) = 0; + // optionally reset the filter when centering + virtual void center() {} }; struct IFilterDialog : public BaseDialog diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index 8fd054b4..a9e60555 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -114,6 +114,8 @@ void Tracker::logic() if (can_center) { + if (libs.pFilter) + libs.pFilter->center(); centerp = false; for (int i = 0; i < 3; i++) t_b[i] = t(i); -- cgit v1.2.3 From 59897ded74a13e2a31a60f9443a64a59e97bb386 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 17 Oct 2015 08:33:12 +0200 Subject: shortcuts: allow for binding scroll lock and pause/break Print screen doesn't seem to work. Issue: #257 --- opentrack/win32-shortcuts.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'opentrack') diff --git a/opentrack/win32-shortcuts.cpp b/opentrack/win32-shortcuts.cpp index bd51ae88..ceee2f9b 100644 --- a/opentrack/win32-shortcuts.cpp +++ b/opentrack/win32-shortcuts.cpp @@ -109,6 +109,9 @@ QList windows_key_sequences = win_key(DIK_RETURN, Qt::Key::Key_Return), win_key(DIK_INSERT, Qt::Key::Key_Insert), win_key(DIK_SPACE, Qt::Key::Key_Space), + //win_key(DIK_SYSRQ, Qt::Key::Key_Print), + win_key(DIK_SCROLL, Qt::Key::Key_ScrollLock), + win_key(DIK_PAUSE, Qt::Key::Key_Pause), }); bool win_key::to_qt(const Key& k, QKeySequence& qt_, Qt::KeyboardModifiers &mods) -- cgit v1.2.3 From c47260fbc4045d62063ba7f952fda1b46e0a10ea Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 17 Oct 2015 08:33:28 +0200 Subject: shortcuts: alias right modifier keys to left modifier keys Issue: #257 Closes #257 --- opentrack/shortcuts.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'opentrack') diff --git a/opentrack/shortcuts.cpp b/opentrack/shortcuts.cpp index ba2b7c8e..3ad8e9be 100644 --- a/opentrack/shortcuts.cpp +++ b/opentrack/shortcuts.cpp @@ -96,9 +96,9 @@ void KeybindingWorker::run() { case DIK_RALT: break; default: - k.shift = !!(keystate[DIK_LSHIFT] & 0x80); - k.alt = !!(keystate[DIK_LALT] & 0x80); - k.ctrl = !!(keystate[DIK_LCONTROL] & 0x80); + k.shift = !!(keystate[DIK_LSHIFT] & 0x80) || !!(keystate[DIK_RSHIFT] & 0x80); + k.alt = !!(keystate[DIK_LALT] & 0x80) || !!(keystate[DIK_RALT] & 0x80); + k.ctrl = !!(keystate[DIK_LCONTROL] & 0x80) || !!(keystate[DIK_RCONTROL] & 0x80); k.keycode = i; receiver(k); break; -- cgit v1.2.3 From 86418fa6feeb199df96146ba2343f4b9fdb54c21 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 17 Oct 2015 08:36:16 +0200 Subject: shortcuts: actually print screen binding works It works only if Dropbox doesn't hook the key Issue: #257 --- opentrack/win32-shortcuts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'opentrack') diff --git a/opentrack/win32-shortcuts.cpp b/opentrack/win32-shortcuts.cpp index ceee2f9b..feaf6036 100644 --- a/opentrack/win32-shortcuts.cpp +++ b/opentrack/win32-shortcuts.cpp @@ -109,7 +109,7 @@ QList windows_key_sequences = win_key(DIK_RETURN, Qt::Key::Key_Return), win_key(DIK_INSERT, Qt::Key::Key_Insert), win_key(DIK_SPACE, Qt::Key::Key_Space), - //win_key(DIK_SYSRQ, Qt::Key::Key_Print), + win_key(DIK_SYSRQ, Qt::Key::Key_Print), win_key(DIK_SCROLL, Qt::Key::Key_ScrollLock), win_key(DIK_PAUSE, Qt::Key::Key_Pause), }); -- cgit v1.2.3 From 9af18404a44f68a3d65bf30843abc99b27ed68f7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 17 Oct 2015 10:51:22 +0200 Subject: tracker: check for NaN values Issue: #255 --- opentrack/tracker.cpp | 126 +++++++++++++++++++++++++++++++++++++------------- opentrack/tracker.h | 2 +- 2 files changed, 96 insertions(+), 32 deletions(-) (limited to 'opentrack') diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index a9e60555..ad10e396 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -62,6 +62,44 @@ void Tracker::t_compensate(const rmat& rmat, const double* xyz, double* output, output[0] = -ret(1); } +static inline bool nanp(double value) +{ + return std::isnan(value) || std::isinf(value); +} + +static inline double elide_nan(double value, double def) +{ + if (nanp(value)) + { + if (nanp(def)) + return 0; + return def; + } + return value; +} + +static bool is_nan(const dmat<3,3>& r, const dmat<3, 1>& t) +{ + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + if (nanp(r(i, j))) + return true; + + for (int i = 0; i < 3; i++) + if (nanp(t(i))) + return true; + + return false; +} + +static bool is_nan(const Pose& value) +{ + for (int i = 0; i < 6; i++) + if (nanp(value(i))) + return true; + return false; +} + void Tracker::logic() { bool inverts[6] = { @@ -72,12 +110,12 @@ void Tracker::logic() m(4).opts.invert, m(5).opts.invert, }; - + static constexpr double pi = 3.141592653; static constexpr double r2d = 180. / pi; - + Pose value, raw; - + for (int i = 0; i < 6; i++) { auto& axis = m(i); @@ -89,6 +127,9 @@ void Tracker::logic() raw(i) = newpose[i]; } + if (is_nan(raw)) + raw = last_raw; + const double off[] = { (double)-s.camera_yaw, (double)-s.camera_pitch, @@ -97,12 +138,13 @@ void Tracker::logic() const rmat cam = rmat::euler_to_rmat(off); rmat r = rmat::euler_to_rmat(&value[Yaw]); dmat<3, 1> t(value(0), value(1), value(2)); - + r = cam * r; - + bool can_center = false; - - if (centerp) + const bool nan = is_nan(r, t); + + if (centerp && !nan) { for (int i = 0; i < 6; i++) if (fabs(newpose[i]) != 0) @@ -111,7 +153,7 @@ void Tracker::logic() break; } } - + if (can_center) { if (libs.pFilter) @@ -121,7 +163,7 @@ void Tracker::logic() t_b[i] = t(i); r_b = r; } - + { double tmp[3] = { t(0) - t_b[0], t(1) - t_b[1], t(2) - t_b[2] }; t_compensate(cam, tmp, tmp, false); @@ -143,35 +185,57 @@ void Tracker::logic() value(i+3) = euler(i) * r2d; } } - + + bool nan_ = false; + // we're checking NaNs after every block of numeric ops + if (is_nan(value)) + { + nan_ = true; + } + else { Pose tmp = value; - + if (libs.pFilter) libs.pFilter->filter(tmp, value); - } - for (int i = 0; i < 6; i++) - value(i) = map(value(i), m(i)); - - if (s.tcomp_p) - t_compensate(rmat::euler_to_rmat(&value[Yaw]), - value, - value, - s.tcomp_tz); + for (int i = 0; i < 6; i++) + value(i) = map(value(i), m(i)); - for (int i = 0; i < 6; i++) - value(i) += m(i).opts.zero; + if (s.tcomp_p) + t_compensate(rmat::euler_to_rmat(&value[Yaw]), + value, + value, + s.tcomp_tz); - for (int i = 0; i < 6; i++) - value[i] *= inverts[i] ? -1. : 1.; + for (int i = 0; i < 6; i++) + value(i) += m(i).opts.zero; - if (zero_) for (int i = 0; i < 6; i++) - value(i) = 0; + value[i] *= inverts[i] ? -1. : 1.; + + if (zero_) + for (int i = 0; i < 6; i++) + value(i) = 0; + + if (is_nan(value)) + nan_ = true; + } + + if (nan_) + { + value = last_mapped; + + // for widget last value display + for (int i = 0; i < 6; i++) + (void) map(value(i), m(i)); + } libs.pProtocol->pose(value); + last_mapped = value; + last_raw = raw; + QMutexLocker foo(&mtx); output_pose = value; raw_6dof = raw; @@ -179,7 +243,7 @@ void Tracker::logic() void Tracker::run() { const int sleep_ms = 3; - + #if defined(_WIN32) (void) timeBeginPeriod(1); #endif @@ -187,14 +251,14 @@ void Tracker::run() { while (!should_quit) { t.start(); - + double tmp[6] {0,0,0, 0,0,0}; libs.pTracker->data(tmp); - + if (enabledp) for (int i = 0; i < 6; i++) - newpose[i] = tmp[i]; - + newpose[i] = elide_nan(tmp[i], newpose[i]); + logic(); long q = sleep_ms * 1000L - t.elapsed()/1000L; diff --git a/opentrack/tracker.h b/opentrack/tracker.h index c5c39797..b0e89455 100644 --- a/opentrack/tracker.h +++ b/opentrack/tracker.h @@ -48,7 +48,7 @@ private: Mappings& m; Timer t; - Pose output_pose, raw_6dof; + Pose output_pose, raw_6dof, last_mapped, last_raw; double newpose[6]; volatile bool centerp; -- cgit v1.2.3 From 5f20a56e3d948d44a856a529d490e330a1adb57f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 17 Oct 2015 11:06:02 +0200 Subject: cmake: generate version.cc --- CMakeLists.txt | 29 +++++++++++++++++++++-------- opentrack/version.cc | 9 --------- 2 files changed, 21 insertions(+), 17 deletions(-) delete mode 100644 opentrack/version.cc (limited to 'opentrack') diff --git a/CMakeLists.txt b/CMakeLists.txt index 67064d76..cb9dc8b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,10 +14,26 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/) include(GetGitRevisionDescription) find_package(Git QUIET) if(GIT_FOUND) - git_describe(OPENTRACK__COMMIT --tags --always) + git_describe(OPENTRACK_COMMIT --tags --always) endif() -file(WRITE ${CMAKE_BINARY_DIR}/opentrack-version.h "#define OPENTRACK_VERSION \"${OPENTRACK__COMMIT}\"") +file(WRITE ${CMAKE_BINARY_DIR}/opentrack-version.h "#define OPENTRACK_VERSION \"${OPENTRACK_COMMIT}\"") + +## start crapola + +file(WRITE ${CMAKE_BINARY_DIR}/version.cc " +#include \"opentrack-compat/export.hpp\" + +#ifdef __cplusplus +extern \"C\" +#endif +OPENTRACK_EXPORT +const char* opentrack_version; + +const char* opentrack_version = \"${OPENTRACK_COMMIT}\"; +") + +## end crapola SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) @@ -187,7 +203,7 @@ if(filename-hash_0) endif() string(REPLACE "refs/heads/" "" filename-branch_1 "${filename-branch_0}") string(REPLACE "/" "-" filename-branch "${filename-branch_1}") -set(filename_0 "${OPENTRACK__COMMIT}") +set(filename_0 "${OPENTRACK_COMMIT}") set(filename "${CMAKE_BINARY_DIR}/${filename_0}.zip") add_custom_command(OUTPUT ${filename} COMMAND env sh "${CMAKE_SOURCE_DIR}/make-tar.sh" "${CMAKE_INSTALL_PREFIX}" "${filename}") @@ -274,11 +290,8 @@ opentrack_compat(opentrack-spline-widget) target_include_directories(opentrack-spline-widget PUBLIC qfunctionconfigurator/) target_link_libraries(opentrack-spline-widget ${MY_QT_LIBS}) -add_library(opentrack-version STATIC opentrack/version.cc) +add_library(opentrack-version STATIC ${CMAKE_BINARY_DIR}/version.cc) opentrack_compat(opentrack-version) -set_target_properties(opentrack-version PROPERTIES - COMPILE_DEFINITIONS - "OPENTRACK_VERSION=\"${OPENTRACK__COMMIT}\"") opentrack_library(opentrack-filter-accela ftnoir_filter_accela) target_link_libraries(opentrack-filter-accela opentrack-spline-widget) @@ -570,6 +583,6 @@ if(APPLE) \"${CMAKE_SOURCE_DIR}/macosx\" \"${CMAKE_INSTALL_PREFIX}\" \"${CMAKE_BINARY_DIR}\" - \"${OPENTRACK__COMMIT}\") + \"${OPENTRACK_COMMIT}\") ") endif() diff --git a/opentrack/version.cc b/opentrack/version.cc deleted file mode 100644 index 9e75a336..00000000 --- a/opentrack/version.cc +++ /dev/null @@ -1,9 +0,0 @@ -#include "opentrack-compat/export.hpp" - -#ifdef __cplusplus -extern "C" -#endif -OPENTRACK_EXPORT -const char* opentrack_version; - -const char* opentrack_version = OPENTRACK_VERSION; -- cgit v1.2.3 From 55de6ead40cd7120cfd798715cbfc57eb05b417d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 18 Oct 2015 09:33:24 +0200 Subject: tracker: initialize newpose In newpose[i] = elide_nan(tmp[i], newpose[i]); uninitialized memory can be used. --- opentrack/tracker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'opentrack') diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index ad10e396..6411db40 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -24,6 +24,7 @@ Tracker::Tracker(main_settings& s, Mappings &m, SelectedLibraries &libs) : s(s), m(m), + newpose {0,0,0, 0,0,0}, centerp(s.center_at_startup), enabledp(true), zero_(false), @@ -254,7 +255,7 @@ void Tracker::run() { double tmp[6] {0,0,0, 0,0,0}; libs.pTracker->data(tmp); - + if (enabledp) for (int i = 0; i < 6; i++) newpose[i] = elide_nan(tmp[i], newpose[i]); -- cgit v1.2.3 From d9746e7d4c4f7ed687c23b746914a9c5af8e9b49 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 20 Oct 2015 03:24:30 +0200 Subject: all: update copyright where appropriate --- ftnoir_protocol_sc/ftnoir_protocol_sc.cpp | 26 ++++++++++++++----------- ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | 1 + ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp | 1 + ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h | 1 + ftnoir_tracker_pt/point_extractor.cpp | 1 + ftnoir_tracker_pt/pt_video_widget.cpp | 1 + opentrack-compat/process-list.hpp | 7 +++++++ opentrack/shortcuts.cpp | 2 +- opentrack/win32-shortcuts.cpp | 8 ++++++++ qfunctionconfigurator/functionconfig.cpp | 8 ++++++++ qfunctionconfigurator/functionconfig.h | 2 +- qfunctionconfigurator/qfunctionconfigurator.cpp | 7 +++++++ qfunctionconfigurator/qfunctionconfigurator.h | 2 +- 13 files changed, 53 insertions(+), 14 deletions(-) (limited to 'opentrack') diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp index 5d7ab778..0c6cb486 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp @@ -1,9 +1,13 @@ -/* Copyright (c) 2015 Stanislaw Halik - * Copyright (c) 2015 Wim Vriend - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. +/* Homepage http://facetracknoir.sourceforge.net/home/default.htm * + * * + * ISC License (ISC) * + * * + * Copyright (c) 2015, Wim Vriend + * Copyright (c) 2014, Stanislaw Halik + * * + * Permission to use, copy, modify, and/or distribute this software for any * + * purpose with or without fee is hereby granted, provided that the above * + * copyright notice and this permission notice appear in all copies. * */ #include "ftnoir_protocol_sc.h" #include "opentrack/plugin-api.hpp" @@ -80,7 +84,7 @@ public: # define PREFIX "" #else # define PREFIX "lib" -#endif +#endif QString path = QCoreApplication::applicationDirPath() + "/" PREFIX "opentrack-proto-simconnect.dll"; QByteArray name = QFile::encodeName(path); actx.lpSource = name.constData(); @@ -113,11 +117,11 @@ private: }; bool FTNoIR_Protocol::correct() -{ - if (!SCClientLib.isLoaded()) +{ + if (!SCClientLib.isLoaded()) { ActivationContext ctx(142 + static_cast(s.sxs_manifest)); - + if (ctx.is_ok()) { SCClientLib.setFileName("SimConnect.dll"); @@ -171,7 +175,7 @@ void FTNoIR_Protocol::handle() void CALLBACK FTNoIR_Protocol::processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWORD, void *self_) { FTNoIR_Protocol& self = *reinterpret_cast(self_); - + switch(pData->dwID) { default: diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp index 29b32dad..2db5006c 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp @@ -1,4 +1,5 @@ /* Copyright (c) 2012 Patrick Ruoff + * Copyright (c) 2014-2015 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp index da7a6113..b1ae2238 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.cpp @@ -1,4 +1,5 @@ /* Copyright (c) 2012 Patrick Ruoff + * Copyright (c) 2014-2015 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h b/ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h index d7ddb6a9..85eec8f9 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_settings.h @@ -1,4 +1,5 @@ /* Copyright (c) 2012 Patrick Ruoff + * Copyright (c) 2014-2015 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/ftnoir_tracker_pt/point_extractor.cpp b/ftnoir_tracker_pt/point_extractor.cpp index a1e61f28..ec37dd00 100644 --- a/ftnoir_tracker_pt/point_extractor.cpp +++ b/ftnoir_tracker_pt/point_extractor.cpp @@ -1,4 +1,5 @@ /* Copyright (c) 2012 Patrick Ruoff + * Copyright (c) 2014-2015 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/ftnoir_tracker_pt/pt_video_widget.cpp b/ftnoir_tracker_pt/pt_video_widget.cpp index 9f2b90f6..cbb7c268 100644 --- a/ftnoir_tracker_pt/pt_video_widget.cpp +++ b/ftnoir_tracker_pt/pt_video_widget.cpp @@ -1,4 +1,5 @@ /* Copyright (c) 2012 Patrick Ruoff + * Copyright (c) 2015 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/opentrack-compat/process-list.hpp b/opentrack-compat/process-list.hpp index 65735740..ef3b325f 100644 --- a/opentrack-compat/process-list.hpp +++ b/opentrack-compat/process-list.hpp @@ -1,3 +1,10 @@ +/* Copyright (c) 2015 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + #pragma once #include diff --git a/opentrack/shortcuts.cpp b/opentrack/shortcuts.cpp index 3ad8e9be..718dd778 100644 --- a/opentrack/shortcuts.cpp +++ b/opentrack/shortcuts.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, Stanislaw Halik +/* Copyright (c) 2014-2015, Stanislaw Halik * Permission to use, copy, modify, and/or distribute this * software for any purpose with or without fee is hereby granted, diff --git a/opentrack/win32-shortcuts.cpp b/opentrack/win32-shortcuts.cpp index feaf6036..96232631 100644 --- a/opentrack/win32-shortcuts.cpp +++ b/opentrack/win32-shortcuts.cpp @@ -1,3 +1,11 @@ +/* Copyright (c) 2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #if defined(_WIN32) # ifndef DIRECTINPUT_VERSION # define DIRECTINPUT_VERSION 0x800 diff --git a/qfunctionconfigurator/functionconfig.cpp b/qfunctionconfigurator/functionconfig.cpp index 8c0bbc9f..cac8121c 100644 --- a/qfunctionconfigurator/functionconfig.cpp +++ b/qfunctionconfigurator/functionconfig.cpp @@ -1,3 +1,11 @@ +/* Copyright (c) 2012-2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #include #include #include diff --git a/qfunctionconfigurator/functionconfig.h b/qfunctionconfigurator/functionconfig.h index 31aebdf6..6d76d0de 100644 --- a/qfunctionconfigurator/functionconfig.h +++ b/qfunctionconfigurator/functionconfig.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, Stanislaw Halik +/* Copyright (c) 2012-2015, Stanislaw Halik * Permission to use, copy, modify, and/or distribute this * software for any purpose with or without fee is hereby granted, diff --git a/qfunctionconfigurator/qfunctionconfigurator.cpp b/qfunctionconfigurator/qfunctionconfigurator.cpp index e62049db..bcb895ec 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.cpp +++ b/qfunctionconfigurator/qfunctionconfigurator.cpp @@ -1,3 +1,10 @@ +/* Copyright (c) 2012-2015 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + #include "opentrack/options.hpp" using namespace options; #include "qfunctionconfigurator/qfunctionconfigurator.h" diff --git a/qfunctionconfigurator/qfunctionconfigurator.h b/qfunctionconfigurator/qfunctionconfigurator.h index 8957c898..667886cd 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.h +++ b/qfunctionconfigurator/qfunctionconfigurator.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014 Stanislaw Halik +/* Copyright (c) 2012-2015 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above -- cgit v1.2.3 From 6e5694f995454b48478e30abf432bb78dedd81c1 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 20 Oct 2015 09:07:45 +0200 Subject: shortcuts: fix osx/linux keystrokes persisting --- opentrack/shortcuts.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'opentrack') diff --git a/opentrack/shortcuts.cpp b/opentrack/shortcuts.cpp index 718dd778..91480d16 100644 --- a/opentrack/shortcuts.cpp +++ b/opentrack/shortcuts.cpp @@ -120,6 +120,8 @@ void Shortcuts::bind_keyboard_shortcut(K &key, key_opts& k) else { key->setShortcut(QKeySequence::UnknownKey); key->setEnabled(false); + std::shared_ptr ptr = K(); + key.swap(ptr); } if (k.keycode != "") -- cgit v1.2.3