NK2Tray icon indicating copy to clipboard operation
NK2Tray copied to clipboard

trigger scripts/programs with unused key

Open vabene1111 opened this issue 5 years ago • 4 comments

related to #32

would be a great feature for all the unused buttons

vabene1111 avatar Oct 08 '19 15:10 vabene1111

I think scripts would be a little bit much. I would say we could start programs or trigger shortcuts. (i have a finished sample for the keyboard shortcuts. not triggered by midi but by a sw button) and with the shortcuts the people who wants it could trigger an autohotkey script or something like this

ReapersDragon avatar Oct 14 '19 16:10 ReapersDragon

ah sry, i think scripts is a little misleading .. i basically mean .bat or .ps2 scripts (which are basically a form or program so if we build program support these will be supported more or less by default).

But i agree, a custom script engine is overkill

vabene1111 avatar Oct 15 '19 17:10 vabene1111

Hey there, I'm using NK2Tray since a few hours and I love it so far but stumbled upon the same issue. Here's a little vision of mine how this could be integrated without bloating the program too much: right click on tray icon => Run custom program => a list of maybe the two track and 3 marker buttons <= on click you get a text box in which you can enter the path to your .exe file of the program you want to run. I don't know how difficult this is to realise, but i think (or better hope ;) ) this shouldn't bloat the program too much

Haze1707 avatar May 20 '20 19:05 Haze1707

Hi, AtticJack provided me with a beta build to test the feature, so I did a little bit of scripting to change my default audio device.

So for anyone who is interested here is my Script to toggle the default audio devices for anyone who seeks to do the same:

@ECHO OFF if exist C:\NK2\toggle.txt goto :2

C:\NK2\NIRCMD\NIRCMDC setdefaultsounddevice “Speakers” 2 C:\NK2\NIRCMD\NIRCMDC setdefaultsounddevice “Speakers” 1 echo toggle>>C:\NK2\toggle.txt

exit :2 C:\NK2\NIRCMD\NIRCMDC setdefaultsounddevice “Headset” 2 C:\NK2\NIRCMD\NIRCMDC setdefaultsounddevice “Headset” 1 del C:\NK2\toggle.txt /q

exit

and a little explanation: You need nircmd (https://www.nirsoft.net/utils/nircmd.html) for it to work. With the nircmd command setdefaultsounddevice you can change the default device, the parameter 1 (or 2) is there to determine the audio device (1) and the communication device (2), if you chose to use your default device in discord for example it uses your communication device, spotify for example uses the "normal" audio device. If you don't want to change the communication device you can delete the rows with the parameter 2. IMPORTANT: the name of your sound devices in windows have to match the name in the script (here "Headset" and "Speakers"). You can change the names via the windows control panel (the old and good one) => sound, there you'll find a list of your devices and you can rename them.

Haze1707 avatar May 25 '20 09:05 Haze1707