Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Cmd+Period doesn't work in Qt GUI windows #561

Open
scztt opened this Issue · 20 comments

6 participants

scztt Tim Blechmann danstowell Julian Rohrhuber Jakob Leben muellmusik
scztt
Owner

Steps:
1. Start a routine: r { inf.do({ ".".postln; 1.wait }) }.play;
2. Generate an SC window: Window.new.front;
3. Cmd+period

Result:
Nothing (routine continues)

Expected:
Cmd+period should work the same in the IDE and in SC-generated windows.

Tim Blechmann

duplicate of #541 (please check existing issues before filing new ones)

scztt
Owner

#541 is about the ide's help browser. Mine was about windows generated from sclang. It wasn't clear to me that these were the same issue - if they are, I'm happy with closing this.

danstowell
Owner
scztt
Owner

Cmd+period feels like a special case. It's pretty central in the SC workflow for killing ongoing processing during the development process. If you have to switch between apps to do it, it's going to be rather annoying.

Tim Blechmann

in the qt gui, i've installed a global key action, which should trigger CmdPeriod.run to work around this issue. testing a bit, it does not seem to work in every window, though. server window, help browsers pass on the even, simple window or the server meters don't. jakob?

Julian Rohrhuber
Owner
Jakob Leben
Owner

Currently the keyDown event is passed up from the view instance to the window. What about passing it on further to the IDE, at least for some bindings?

Wouldn't help on its own, without being able to get the current code selection to evaluate...

Julian Rohrhuber
Owner
Tim Blechmann

btw, one may want to use bare sclang without scapp or scide, e.g. for standalone instruments. in these cases one cannot defer the event to the ide

Julian Rohrhuber
Owner
Jakob Leben
Owner

Actually, I'm not sure this is a good idea anyway. It is a heritage in SC.app, but isn't it dangerous, that CmdPeriod can be triggered from any window, in a live performance situation?

I don't think CmdPeriod should be called from SC windows by default, at least not without a user being able to disable CmdPeriod at will. Maybe we should add CmdPeriod:-enabled property?

Jakob Leben
Owner

in the qt gui, i've installed a global key action, which should trigger CmdPeriod.run to work around this issue. testing a bit, it does not seem to work in every window, though. server window, help browsers pass on the even, simple window or the server meters don't. jakob?

This was faulty anyway, because it set globalKeyDownAction variable directly, instead of calling globalKeyDownAction_ method.

See:

  *initClass {
    hSizePolicy = [1,2,3,1,2,3,1,2,3];
    vSizePolicy = [1,1,1,2,2,2,3,3,3];

    if (thisProcess.platform.ideName != "scapp") {
      globalKeyDownAction = { |view, char, modifier, keycode|
[...]
Jakob Leben
Owner

This was faulty anyway, because it set globalKeyDownAction variable directly, instead of calling globalKeyDownAction_ method.

Moreover, I also object to using globalKeyDownAction in the default class library at all, because that would involve calling the interpreter from GUI on every single key press in any view.

A different solution should be found anyway.

muellmusik
Owner
muellmusik
Owner
Jakob Leben
Owner

Moreover, I also object to using globalKeyDownAction in the default class library at all, because that would involve calling the interpreter from GUI on every single key press in any view.

Doesn't that already happen? Or does Qt filter out views that have no key actions?

Exactly, Qt only calls interpreter after a keyDownAction has been installed on a view

Then maybe the GUI can detect Cmd-. and only call the interpreter when needed.

Yes, that was my idea as well...

Jakob Leben
Owner

It is actually fairly configurable already. (See the various Boolean values.)

Erm, sorry, could you elaborate?

Jakob Leben
Owner

Ok, this is now fixed. For real.

muellmusik
Owner
Jakob Leben
Owner

Reportedly CmdPeriod on Qt GUI windows still does not work on OS X.

Jakob Leben jleben reopened this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.