From 9a6e616b6e785b7e0a89b27d05b6ef3990b3e139 Mon Sep 17 00:00:00 2001 From: Denis Manherz Date: Mon, 26 Aug 2024 11:38:56 +0200 Subject: [PATCH] Weird shit --- .envrc | 1 + .gitignore | 1 + .vscode/launch.json | 13 +- .vscode/settings.json | 3 + .vscode/tasks.json | 34 +++ flake.nix | 9 +- .../mouse_config_and_macro_hexanalysis.txt | 215 ++++++++++++++++++ launch.json | 19 -- src/CMakeLists.txt | 3 + src/Main.qml | 71 +----- src/main.cpp | 20 +- 11 files changed, 281 insertions(+), 108 deletions(-) create mode 100644 .envrc create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json create mode 100755 hex_sequence_analysis/mouse_config_and_macro_hexanalysis.txt delete mode 100644 launch.json diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 567609b..eb0b272 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build/ +.direnv/ diff --git a/.vscode/launch.json b/.vscode/launch.json index f317667..2f511c3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,17 +4,14 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { - "name": "debug", + "name": "Debug", "type": "lldb", "request": "launch", - "program":"./build/bin/kirigami-hello", - "cwd":"$workspaceRoot", - "preRunCommands": [ - "echo a", - "cmake -B build", - "cmake --build build" - ] + "program": "./build/bin/kirigami-hello", + "cwd": "${workspaceRoot}", + "preLaunchTask": "CMake: build" } ], } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..cad7657 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "cmake.configureOnOpen": false +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..1cd061d --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,34 @@ +{ + "tasks": [ + { + "type": "process", + "command": "/usr/bin/env", + "args": [ + "CC=clang", + "CFLAGS=-g -Wall", + "make", + "${fileBasenameNoExtension}" + ], + "options": { + "cwd": "${fileDirname}" + }, + "group": { + "kind": "build", + "isDefault": true + }, + "label": "makelldb: selected file" + }, + { + "type": "cmake", + "label": "CMake: build", + "command": "build", + "targets": [ + "all" + ], + "group": "build", + "problemMatcher": [], + "detail": "CMake template build task" + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/flake.nix b/flake.nix index 9688c2c..b636613 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,7 @@ default = pkgs.mkShell { propagatedBuildInputs = with pkgs; [ bashInteractive + libusb1 cmake gcc gdb @@ -32,14 +33,6 @@ qtcreator qt6.full ]; - # This creates the proper qt env so that plugins are found right. - shellHook = '' - setQtEnvironment=$(mktemp --suffix .setQtEnvironment.sh) - echo "shellHook: setQtEnvironment = $setQtEnvironment" - makeWrapper "/bin/sh" "$setQtEnvironment" "''${qtWrapperArgs[@]}" - sed "/^exec/d" -i "$setQtEnvironment" - source "$setQtEnvironment" - ''; }; }; }; diff --git a/hex_sequence_analysis/mouse_config_and_macro_hexanalysis.txt b/hex_sequence_analysis/mouse_config_and_macro_hexanalysis.txt new file mode 100755 index 0000000..cb37de8 --- /dev/null +++ b/hex_sequence_analysis/mouse_config_and_macro_hexanalysis.txt @@ -0,0 +1,215 @@ +First Part + +0000 08 21 00 92 00 00 00 00 64 17 04 15 00 0c 00 0f +0010 00 13 00 17 00 1b 00 00 00 00 00 00 00 00 00 00 +0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0030 00 00 ff 00 ff ff ff 00 ff ff 9b 00 00 ff 00 ff +0040 ff ff ff 46 00 02 43 00 36 ff 00 00 32 07 ff ff +0050 ff 00 00 00 ff ff ff 00 00 00 ff ff ff 00 00 00 +0060 ff ff ff 02 02 00 ff 00 00 00 ff 00 00 00 ff 00 +0070 00 00 00 ff ff ff 46 00 ff 00 ff ff ff ff ff 00 +0080 00 ff 00 00 01 02 03 04 05 06 07 42 42 02 ff 00 +0090 00 27 40 01 02 ff 00 00 a5 00 00 00 00 00 00 00 +00a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0200 00 00 00 00 00 00 00 00 + +0x08-0x09 0x63 0x17 Profil 1, 0x63 0x01 Profil 2 ????? +2 Hex Dumps for 1 Profile + +FUCK ICH GLAUB ICH HABE HEX FALSCH GEZÄHLT HAB MANCHMAL VON 1 ANGEFANGEN LOL + +0x0a USB Polling Rate [0x01-0x04]->[125,250,500,1000] +0x0c 0x11-0x15 wert für häckchen bei dpi, erstes 0x11 zweites 0x12 usw.. +0x0d-0x16 jeweils 2 byte most significant byte last, * 50 -> annäherung an dpi -50 + +0x45 -> Lighting Mode, 02 Steady, 01 Colorful Streaming, 03 Breathing +0x47 -> 0-4 Brightness und 0-4 Speed bei colorful 0x(br)(sp) +0x48 -> Brightness bei Steady 00-40 +0x4c -> 0-4 Brightness und 0-4 Speed bei steady 0x(br)(sp) +0x4e-0x63 -> Bei Breathing RGB * 7 +0x67-0x7a -> Bei Steady RGB * 7 +bei einem modus wechsel ändert sich brightness und speed nicht auser man ändert sie nochmal explizit + + +Mouse Sensitivity and Improve Pointer Precision does nothing +And the rest of the settings on advanced page are system settings + + +------- + +Part two + +0000 08 22 00 50 00 00 00 00 11 01 00 00 11 02 00 00 +0010 11 04 00 00 11 08 00 00 11 10 00 00 21 00 61 00 +0020 41 00 00 00 50 06 00 00 41 02 00 00 41 00 00 00 +0030 21 02 5b 00 21 00 5c 00 21 00 5d 00 21 00 5e 00 +0040 21 00 5f 00 21 00 60 00 50 01 00 00 50 01 00 00 +0050 50 01 00 00 50 01 00 00 a5 00 00 00 00 00 00 00 +0060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0200 00 00 00 00 00 00 00 00 + +--was machen die ersten 8 bytes?-- +0x08-0x0b 4 Byte für linke Maustaste +0x0c-0x0f 4 Byte für rechte Maustaste +0x10-0x13 4 Byte für Mausrad taste +0x14-0x17 4 Byte für taste 13, Zurück Taste, über taste 5,6 +0x18-0x1b 4 Byte für taste 12, Forward Taste, über taste 2,4 +0x1c-0x1f 4 Byte für taste 14, 1. über mausrad +0x20-0x23 4 Byte für taste 15, 2. über mausrad +--was machen die 4 Byte die hier leer sind ?-- +0x28-0x47 Jeweils 4 Byte (3 Sicher) für die Belegung der Tasten 1-8 an der Seite + +Tastenbelegung + Leftclick -> 0x11 0x01 0x00, restliche 2 Byte egal? -> schätze nicht werden mit null geschrieben wenn was anderes drinnen stand + Rightclick -> 0x11 0x02 0x00, restliche 2 Byte egal? + Forward -> 0x11 0x10 0x00 0x00 + Backward -> 0x11 0x08 0x00 0x00 + MiddleClick -> 0x11 0x04 0x00 0x00 + ThreeClick -> 0x31 0x01 0x32 0x03, whatever this is? + RGB on/off -> 0x50 0x02 0x00 0x00 -> hat die letzten bytes mit 0 geschrieben + Disable -> 0x50 0x01 0x00 0x00 + Fire Key -> 0x31 0x01 0xff 0x03 -> 0xff ist the firespeed und iie kann man die klick anzahl (3) nicht ändern aber denke ist 0x03 + +Multimedia->Starts with 0x22 + Media Player -> 0x22 0x00 0x01 0x00 + Play/Pause -> 0x22 0x08 0x00 0x00 + next -> 0x22 0x01 0x00 0x00 + prev -> 0x22 0x02 0x00 0x00 + stop -> 0x22 0x04 0x00 0x00 + mute -> 0x22 0x10 0x00 0x00 + vol up -> 0x22 0x40 0x00 0x00 + vol down -> 0x22 0x80 0x00 0x00 + email -> 0x22 0x00 0x10 0x00 + calculator -> 0x22 0x00 0x20 0x00 + explorer -> 0x22 0x00 0x02 0x00 + homepage -> 0x22 0x00 0x00 0x02 + search -> 0x22 0x00 0x00 0x01 + forward -> 0x22 0x00 0x00 0x08 + backward -> 0x22 0x00 0x00 0x04 + stop web -> 0x22 0x00 0x00 0x10 + refresh -> 0x22 0x00 0x00 0x20 + favorites -> 0x22 0x00 0x00 0x40 +DPI starts with 0x41 + DPI Loop 0x41 0x00 0x00 0x00 + DPI+ 0x41 0x01 0x00 0x00 + DPI- 0x41 0x02 0x00 0x00 +restliche Byte egal? -> rest mit null auffüllen + +Key Combination starts with 0x21 then 0x?? mod then 0x?? 0x?? key ???? uff bis zu 3 Keys ohne mod, mod + 2 Keys???? ich check nicht wie das geht oder des geht einfach nicht wie das da steht das es geht +Mods -> Shift 0x02 + Ctrl 0x01 + Alt 0x04 + Win 0x08 + NoMod 0x00 + +Maximal 2 Mods z.b. 1010 -> 0x0a für win+shift +Man kann beliebig viele mods gleichzeitig + +A ist 0x04, b ist 0x05, c ist 0x06 dann hochzählen bis z 0x1d? +0x4c ist delete bzw. entf +0x2a ist backspace +0x59 ist numpad 1 0x5a ist numpad 2 ... 0x61 ist numpad 9 0x62 ist numpad 0 + +Warum zum fick kann man eine Kombination T+T+T eingeben aber das letzte T wird nichtmal gespeichert und nur das erste T wird gedrückt lol + +0x1e ist normal 1, 0x1f ist normal 2 ... 0x26 ist normal 9, 0x27 ist normal 0 + +0x52 ist up arrow, 0x51 down arrow, 0x50 right arrow, 0x4f left arrow + +0x36 , , 0x37 . , 0x2d -, 0x38 #, 0x2e +, 0x30 ´, 0x2f ß, 0x31 ^, 0x00 <, + +0x3a F1 ... 0x45 F12 + +4 Byte 0x70 (Macro) 0x01 (Macro nummer) 0x01 (??) 0x01(??) +0x70 -> Macro mod + + +Macros + +0000 08 30 02 00 00 00 00 00 02 00 06 50 01 04 d0 01 +0010 04 50 01 05 d0 01 05 50 01 06 d0 01 06 00 00 00 +0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +01f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +0200 00 00 00 00 00 00 00 00 + + +wenn macro wird ein extra dingens an data geschrieben mit 0x08 0x30 am anfang +für jedes Macro wird ein extra data geschrieben +0x08 0x30 0x02 0x00 -> macro identifier + +0x08 -> macro nummer + diff --git a/launch.json b/launch.json deleted file mode 100644 index 3402a77..0000000 --- a/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "debug", - "type": "lldb", - "request": "launch", - "program":"./build/bin/kirigami-hello", - "cwd":"$workspaceRoot", - "preRunCommands": [ - "cmake -B build", - "cmake --build build" - ] - } - ], -} \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4f97a9e..c65154c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,7 +25,10 @@ target_link_libraries(kirigami-hello KF6::I18n KF6::CoreAddons KF6::IconThemes + usb-1.0 ) +add_compile_options(-pthread) + install(TARGETS kirigami-hello ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/src/Main.qml b/src/Main.qml index 23d3f43..5d6a491 100644 --- a/src/Main.qml +++ b/src/Main.qml @@ -23,78 +23,9 @@ Kirigami.ApplicationWindow { Controls.Label { // Center label horizontally and vertically within parent object anchors.centerIn: parent - text: i18n("Hello World!") + text: i18n("Hello asdfasdfasdfasfasfasfafasfdfasdfld!") } } - Kirigami.CardsListView { - id: cardsView - model: kountdownModel - delegate: kountdownDelegate - } - ListModel { - id: kountdownModel - // Each ListElement is an element on the list, containing information - ListElement { - name: "Dog birthday!!" - description: "Big doggo birthday blowout." - date: 100 - } - } -Component { - id: kountdownDelegate - Kirigami.AbstractCard { - contentItem: Item { - // implicitWidth/Height define the natural width/height - // of an item if no width or height is specified. - // The setting below defines a component's preferred size based on its content - implicitWidth: delegateLayout.implicitWidth - implicitHeight: delegateLayout.implicitHeight - GridLayout { - id: delegateLayout - anchors { - left: parent.left - top: parent.top - right: parent.right - } - rowSpacing: Kirigami.Units.largeSpacing - columnSpacing: Kirigami.Units.largeSpacing - columns: root.wideScreen ? 4 : 2 - - Kirigami.Heading { - Layout.fillHeight: true - level: 1 - text: date - } - - ColumnLayout { - Kirigami.Heading { - Layout.fillWidth: true - level: 2 - text: name - } - Kirigami.Separator { - Layout.fillWidth: true - visible: description.length > 0 - } - Controls.Label { - Layout.fillWidth: true - wrapMode: Text.WordWrap - text: description - visible: description.length > 0 - } - } - Controls.Button { - Layout.alignment: Qt.AlignRight - Layout.columnSpan: 2 - text: i18n("Edit") - // onClicked: to be done... soon! - } - } - } - } - } - - } diff --git a/src/main.cpp b/src/main.cpp index 0531e04..8d81eef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,8 +6,11 @@ #include #include #include +#include +#include -int main(int argc, char *argv[]) { +int main(int argc, char *argv[]) +{ KIconTheme::initTheme(); // this is not available in nixpkgs version of // KiconTheme QApplication app(argc, argv); @@ -18,7 +21,8 @@ int main(int argc, char *argv[]) { QApplication::setDesktopFileName(QStringLiteral("org.kde.tutorial")); QApplication::setStyle(QStringLiteral("breeze")); - if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) { + if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) + { QQuickStyle::setStyle(QStringLiteral("org.kde.desktop")); } @@ -27,9 +31,19 @@ int main(int argc, char *argv[]) { engine.rootContext()->setContextObject(new KLocalizedContext(&engine)); engine.loadFromModule("org.kde.tutorial", "Main"); - if (engine.rootObjects().isEmpty()) { + if (engine.rootObjects().isEmpty()) + { return -1; } + // discover devices + libusb_device **list; + libusb_device *found = NULL; + ssize_t cnt = libusb_get_device_list(NULL, &list); + ssize_t i = 0; + std::cout << cnt << "\n"; + + libusb_free_device_list(list, 1); + return app.exec(); }