My side project for programming - CAN <-> USB Transreceiver, iCUE replacement, Second keyboard

Do you like to promote your wxWidgets based application or component!? Post it here and let's see what the critics have to say. Also, if you found that ONE wx component the world needs to know about, put it here for future reference.
Post Reply
kurta999
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sun Dec 08, 2019 8:47 pm

My side project for programming - CAN <-> USB Transreceiver, iCUE replacement, Second keyboard

Post by kurta999 »

I would like to share my simple app which is based heavily on wxWidgets, maybe some parts will be useful for somebody. Feel free to write critics and ideas, copy paste from the project whatever you like, it has MIT license.

Download (source + binary):
https://github.com/kurta999/CustomKeyboard

This is a personal project for myself to improve my daily computer usage, particularly with programming and testing. I've implemented things what I really needed to be more productive and accomplish things faster. It's open source, because why not, maybe somebody will benefit from it one day.

Features
  • CustomMacro - Connect a second keyboard and binding macros to it's keys - full GUI support for macro editing (WIP recording mode)
  • Backend for Corsair's G Keys - Bind macros to G keys as those were on second keyboard, without even installing iCUE
  • CAN-USB Transreceiver - Send and Receive CAN Frames to/from CAN bus via computer trough USB - see more info below
  • Command excutor - Bind specific commands (cmds) to GUI buttons, which is then excuted on GUI button click - see more info below
  • StructParser - Generate offsets of C structures
  • ScreenshotSaver - Saving screenshot to .png from clipboard
  • DirectoryBackup - Backup folders to another place(s) from tray menu
  • CPU Power Saver - Saves power by reducing CPU frequency after X idle time to Y percent. For example I can save 10-15W hourly by reducing my overclocked i7 10700K to 800 - 1200Mhz while my PC is in idle. If the median CPU usage gets above max configured percent due to some background tasks, the frequency will be restored and won't be limited again until it falls below configured minimum median load again.
  • LinkCreator - Easy symlink & hardlink creator within Windows' file explorer
  • Sensors - Backend for sensors with SQLite database for measurements & graphs generation to .html file
  • wxWidget's GUI editor - A very basic GUI editor with move & resize support
  • Filesystem browser - List files and directories recursively by size starting from specific path - useful for finding bloat on storage
  • AntiLock - Bypass idle timeout for Windows to avoid lock screen by pressing SCROLL LOCK & moving mouse in given interval
  • AntiNumLock - Doesn't allow to disable NumLock, re-enables it immendiately when it's disabled.
  • TerminalHotkey - Hotkey for terminal, like in Linux. Can be started from Windows Explorer and from Desktop
  • File explorer opener - Open file explorer by sending a specific TCP packet to this application
Explanation
  • CustomMacro - Currently requires an external Nucleo L495ZG board with UART-TTL to USB adapter for transmitting keypresses to PC. The nucleo is just a simple USB Host, which receives key-presses from the connected keyboard and transmits it to PC via UART. It could be done with hooking in windows, but this solution always crashed the debugger in MSVC, so I went with the more expensive way. Macros can be added in configuration page or in settings.ini file directly. Firmware for Nucle board is available here: https://github.com/kurta999/UsbHost
  • Backend for Corsair's G Keys - Corsair pretty well fucked up it's iCUE, sometimes memory usage can grow to 500MB. That's enormeous for an application which runs in background and executes macro for binded keys. It's possible to use CustomMacro feature to bind everything to Corsair's G keys (beside second keyboard, of coruse). This is a simple HID API which receives keypresses for G keys. Supports K95 RGB (18 G keys, older one) and K95 RGB Platinum.
  • CAN-USB Transreceiver - Requires LAWICEL CAN USB or NUCLEO-G474RE board with UART-TTL to USB adapter & Waveshare SN65HVD230 3.3v CAN Transreceiver or something else which converts TTL signals to real CAN signal. Supports standard, extended, ISO-TP (ISO 15765-2) CAN frames, logging and searching between them. Bits and bytes for CAN frame also can be binded to be able to manipulate them easyer with GUI. Firmware for nucleo board is available here: https://github.com/kurta999/CANUSB
  • Command excutor - Binding commands to GUI buttons possible in Cmds.xml or in the "CMD Executor" panel. That command will be executed on Windows with CreateProcess if you click on it's button, see the image below. This is very usful feature if you work often with command line, you don't have to copy paste every comand or type it's alias. Currently one variable parameter can be added to each command, you can change that before execution by clicking with MIDDLE mouse to the command button instead of the LEFT.
  • StructParser - Paste the structure to input dialog and click on prarse. The application automatically calculates offsets for it's members. It's useful if you work with communication and had to calculate the offset of members in bytes manually. Supports embedded structures, struct alignment (fixed alignment supported, pragma pack implementation isn't finished yet), preprocessor definitions & unions.
  • ScreenshotSaver - Press screenshot save key (F12 by default, on second keyboard) and screenshot from the clipboard will be saved to (app path)/Screenshots folder by default as .png file. Can be changed in configuration.
  • DirectoryBackup - Setup backups in configuration or in settings.ini manually and those will appear in tray menu of this application. Click on them, and backing up files will start. Supports ignore list & SHA-256 checksum for backed up files for more secure backups.
  • LinkCreator - Select desired files from File Explorer and click the mark key (key down on second keyboard by default) and files (directories too) will be marked for link creation. Go to target directory where you want to place the links for marked files, press symlink key (KEY UP) by default for symlink or hardlink key (KEY RIGHT) by default for hardlinks. That's all, symlink or hardlink is created from marked files in target directory.
  • Sensors - Backend means simple TCP server with boost asio where sensor conencts and sends measurements. Each measurement is inserted to a local SQLite database and a graph generated with last 30 measurements, last day & last week average data by default, this can be changed in settings.ini. Database is updated in every 10 minutes, but you can update manually by clicking on "Generate graphs" in front panel.
  • wxWidget's GUI editor - Oversimplified GUI editor which sometimes can be useful beside wxFormBuilder. GUI items are movable & resizable - directly without sizers. C++ code generation also implemented, current workspace can be saved & loaded to/from XML file. This part of the project is deprecated, use it only when you know what you're doing. Otherwise stick to sizers.
  • File explorer opener - This function can be useful if you work with VirtualBox or WSL and using samba for accessing specific parts on guest OS filesystem. First you have to map the network drive in Windows, default drive character is Z: (can be changed in settings.ini - "SharedDriveLetter"), also don't forget to enable TCP_Backend in settings.ini. Here is an example command for opening the file explorer on Windows: "echo expw$(pwd) | netcat <TCP_Backend port from settings.ini>". For the best experience, I recommend creating an alias for this command.
Images
MainPage
Image

Sensors
Image

CAN-USB Transreceiver with Bitfield mapping
Image

C Structure parser
Image

Command executor
Image

Macro editor
Image

Main Page under Linux
Image
Last edited by kurta999 on Sat Feb 11, 2023 10:19 pm, edited 3 times in total.
kurta999
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sun Dec 08, 2019 8:47 pm

Re: My side project for programming - CAN <-> USB Transreceiver, iCUE replacement, Second keyboard

Post by kurta999 »

Main post updated with a plenty of things, feel free to write critics :D
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: My side project for programming - CAN <-> USB Transreceiver, iCUE replacement, Second keyboard

Post by doublemax »

For some reason i seem to have missed your original post. This contains a lot of features from many different areas, quite impressive. I'll take a closer look when i have some free time.
Use the source, Luke!
kurta999
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sun Dec 08, 2019 8:47 pm

Re: My side project for programming - CAN <-> USB Transreceiver, iCUE replacement, Second keyboard

Post by kurta999 »

Thank you.

I started this project first as a single app which receives keypresses from the second connected keyboard over the nucleo board, but it just grew bigger and bigger as I had new and new ideas what I should add. Back then 2 years ago even my C++ skills were very limited, working on this app helped me a lot :lol:

Now the biggest part is the CAN-USB Transreceiver I think, because cheap and good ones aren't on the market sadly. I work mainly from home as a software engineer for an automotive company, they won't lend me their 10K$ or even more CAN device which can simulate an entrie car, so I have to create this to help my work and of course, make it less paiful than shitty designed apps available freely.
ollydbg23
Super wx Problem Solver
Super wx Problem Solver
Posts: 438
Joined: Fri Dec 12, 2008 10:31 am

Re: My side project for programming - CAN <-> USB Transreceiver, iCUE replacement, Second keyboard

Post by ollydbg23 »

Good work!
Too many features I see from your description.
kurta999
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sun Dec 08, 2019 8:47 pm

Re: My side project for programming - CAN <-> USB Transreceiver, iCUE replacement, Second keyboard

Post by kurta999 »

Thank you :)
Post Reply