[bug] Shortcut keys not working properly
-
@Christoph-Hart Excellent, thank you, this looks very useful! Did you fix the shortcut key issue too?

-
@d-healey I think the issue is in this line:
https://github.com/christophhart/HISE/blob/fcfdcda74348bf4723479ea92e5ac497dd60f21a/hi_tools/hi_tools/MiscToolClasses.h#L584It checks if the current key press is in the list of assigned key presses, however something on Linux messes with the default comparison operator so you might have to compare them manually (I don't have access to a Linux system at the moment so you need to get your hands dirty yourself). So instead of this line, add something like
for(auto ak: t->keyMap.getKeyPressesAssignedToCommand(idx)) { if(ak.mods == k.mods && ak.getKeyCode() == k.getKeyCode()) { return true; } }(the condition is totally bogus and won't compile), but you might try different things until you find something that works reliably :)
-
@Christoph-Hart Thank you, I'll play around with it.
-
@Christoph-Hart I don't think that is where the problem is. I've been playing around with this some more and here are the steps to reproduce the problem and some things I notice.
Open HISE and go to File >> Edit Shortcuts
Scroll down to the
Duplicate selection at cursoraction, you will notice it is set toctrl+ Dand this does not work on GNU/Linux.Click the
+button and assignctrl + Dto the command.
It will look like this and will work on GNU/Linux.
Close HISE and open the
KeyPressMappings.xmlfile. You will seectrl + Dhas been added correctly.Keep that file open and launch HISE, then close HISE. You'll see the mapping disappears from the xml file.
-
@Christoph-Hart said in [bug] Shortcut keys not working properly:
I don't have access to a Linux system at the moment
Do you need access to one? ;)
-
Any chance of getting this looked at? My last post contains my most recent findings.
-
@Christoph-Hart This one is still an issue, even if I set the key binding manually HISE forgets it (see my post a little further up).
Also in the script editor I used to be able to press ctrl+shift+up cursor to move the current line or selection up or down. This no longer works, although ctrl+shift+down does work.
-
@d-healey said in [bug] Shortcut keys not working properly:
Also in the script editor I used to be able to press ctrl+shift+up cursor to move the current line or selection up or down. This no longer works, although ctrl+shift+down does work.

Works here.
commit f695f0cb22de5c392d57b3ecc16492d4293986b8W11 Version 10.0.22621 Build 22621
-
@aaronventure Oh yeah I should say this is a Linux issue (I think that's established earlier in the thread, but that's ancient history
) -
D David Healey referenced this topic
-
Aha I fixed it. The addShortcut was passing a keypress which included the typed character, but ctrl+d doesn't type a character on any OS as far as I can tell, and this was preventing it detecting the shortcut on Linux. Replacing the typed character with 0 fixes the issue and doesn't cause any problems on Windows or MacOS.
-
D David Healey marked this topic as a question
-
D David Healey has marked this topic as solved
-
@David-Healey And it fixes the second issue where storing CTRL+D as a shortcut in the XML didn't persist between relaunches - because this is expected HISE behaviour when it meets a default shortcut?
-
@dannytaurus Yeah, basically on Windows and MacOS if you tried to reassign ctrl+D to the duplicate command it would give you a popup telling you that the shortcut was already in use. This never appeared on Linux because it didn't recognise it, so it was happy to have two identical shortcuts assigned.
But on restarting HISE it did some checking, saw the duplicate, and removed it.
-
@David-Healey Another quirk, at least on Mac, is that CMD+D is assigned to both ScritpNode > Duplicate Node and Interface Designer > Duplicate selection at cursor.
This works fine within HISE because of the different contexts, but if you assign a different shortcut to either action, then try to assign the default back again, it will remove the other one.
So I suppose the issue is that duplicate shortcuts already exist in HSIE, but the user isn't allowed to assign duplicates themselves. Which is a little confusing.
EDIT: probably not worth the time to attend to either
