StuartPearson Posted June 28, 2023 Posted June 28, 2023 [Current version 0.31] Update: 29-06-23 Added option to detect left mouse button being pressed and released, shortcut from list can be selected to be sent when triggered. Can be used to send clean brush command when using mixer. ----------------------------------------------------------------------------------------------------------------------------------------- I have created a PC (Windows) app with the Affinity suite in mind but will work with any windowed application that accepts keyboard shortcuts. It uses text files to stores sequences of shortcuts that are actioned by clicking their respective button in the app. There is no limit to the number of shortcuts, the text files can be switched between as required. Each button is defined with a description and the sequence, keyboard modifiers that are accepted are: Ctrl Alt Shift Up Down Left Right The first line of the text file configures the target window, the position and size of the buttons along with a couple of other option as follows: Target window name - This can match any part of the window title for the application you want to send the key sequence to. Button horizontal size Button vertical size Start position from the left for first button Start position from the top for first button Distance between adjacent buttons horizontally Distance between adjacent buttons vertically Number of buttons in a row horizontally - will create new row automatically when exceeded Time in milliseconds for target window to be active before key sequence sent Is the application on top of other windows, 1 for yes, 0 for no Clicking on a dark blue button at the end of the named buttons will show a dialog to configure its setting by adding the description and key sequence. Saving the new button details will reload the list. The individual text files can be viewed/edited in the app by clicking the "CONFIGURATION FILE" text, saving will again reload the buttons, this will also apply any changes made to the first configuration line. If the text on the buttons are "greyed out" it means the target window has not been detected. The app will briefly flash green when switching between the text files to show the window has been detected. All feedback is welcome. For anyone concerned running the .exe file here is the clean report from VirusTotal, I do appreciate there is still a level of trust to be gained however and happy to answer any questions. https://www.virustotal.com/gui/file/baf444a32c8d73abf451ce48c8397c95bcd64617fbb73ddd6c22ae2e3bd6aa51 The app is written in VB.Net (Visual Basic), if anyone knows if this can run natively or with modifications/helpers on Mac hardware let me know. The included text file in the zip is named for Affinity Photo, you can just rename and modify as needed or alternatively create one for each app you want to send key sequences to. KeySender.zip Paul Mudditt 1 Quote
v_kyr Posted June 29, 2023 Posted June 29, 2023 23 hours ago, StuartPearson said: The app is written in VB.Net (Visual Basic), if anyone knows if this can run natively or with modifications/helpers on Mac hardware let me know. For .Net stuff under MacOS it would probably need to be written/implemented instead in C# and then of course also would need to have some recompilation (as a multiarchitecture binary Intel+ARM code) under MacOS with .Net for macOS. - See related VS & .Net for Mac... Install .Net on macOS Visual Studio for Mac Visual Studio for Mac 8.10 and .NET on Apple Silicon machines I don't recall that VB.net (MS Visual Basic) was/is available directly for MacOS as a prog language. We once converted a huger C# & C++ project successful to MacOS via the Xamarin environment on MacOS, though needed to install a bunch of pre-requirements (runtimes & libraries ... etc.). - All in all I don't think people would like to install all those runtime & libs overheads, just in order to execute some compiled small executable code here. Since it's even not entirely the same here as with Java, where you only need to have at least a Java runtime machine installed for the JIT intermediate compiled code execution. Thus it's overall probably easier to rewrite the whole then with some cross-platform supporting Basic dialect which generates native executables, or some other cross-platform available programming language here (maybe ideally then a free no commercial one). For some cross-platform Basic dialects (so also for MacOs) see ... Xojo (commercial) PureBasic (commercial) Basic for Qt (free but an old one, thus I'm not sure it's still in active development) ... a maybe possible alternative ... Lazarus (aka free Pascal) Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2
StuartPearson Posted June 29, 2023 Author Posted June 29, 2023 1 hour ago, v_kyr said: For .Net stuff under MacOS it would probably need to be written/implemented instead in C# and then of course also would need to have some recompilation (as a multiarchitecture binary Intel+ARM code) under MacOS with .Net for macOS. - See related VS & .Net for Mac Thanks for the comprehensive response, if I'm feeling up for a challenge I will see if I can get my head round everything I would need to do. I've never managed to work out the C# language as much as others. Quote
v_kyr Posted June 29, 2023 Posted June 29, 2023 2 hours ago, StuartPearson said: I've never managed to work out the C# language as much as others. C# (as the former times MS own Java replacement) is a pretty cool and also powerful language and conceptual very similar to Java. Thus for Java developers usually easy to adapt to. But for what you have in mind here, aka cross-platform compatibility, other native compilable languages (C/C++, Rust ...) are overall still better suited. So for you, if you know just Basic well, then the way to go would be to use some cross-platform Basic then. Here from what I saw, that PureBasic variant looks interesting, as it is much cheaper than Xojo and available for all platforms. There are (according to their website) even free versions of PureBasic (limited to small programs) available as downloads: Quote Windows PureBasic free for Windows (x64 - 64-bit) OS X Important: XCode has to be installed (with command line tools) to be able to run PureBasic on OS X PureBasic free for OS X (Intel - x64) PureBasic free for OS X (M1/M2 - arm64) That looks like something usable for tryouts here, in order to build some cross-platform executables (Win, Mac). - Maybe you should take a closer look on that basic system then. Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.