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

Closed
scztt opened this Issue Oct 3, 2012 · 23 comments

7 participants

@scztt

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.

@timblechmann

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

@scztt

#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
SuperCollider member
@scztt

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.

@timblechmann

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?

@telephon
SuperCollider member
@jleben
SuperCollider member

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...

@telephon
SuperCollider member
@timblechmann

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

@telephon
SuperCollider member
@jleben
SuperCollider member

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?

@jleben
SuperCollider member

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|
[...]
@jleben
SuperCollider member

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
@muellmusik
@jleben
SuperCollider member

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...

@jleben
SuperCollider member

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

Erm, sorry, could you elaborate?

@jleben
SuperCollider member

Ok, this is now fixed. For real.

@muellmusik
@jleben
SuperCollider member

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

@jleben jleben reopened this Feb 17, 2013
@scztt scztt added this to the 3.7 milestone Apr 17, 2015
@jleben jleben was assigned by scztt Apr 17, 2015
@scztt

This has worked fine for a while. Tested in 3.7 alpha and see no problems whatsoever. Close?

@scztt scztt added the retest label May 26, 2015
@adcxyz

Tested again today, does here on 3.7alpha, 10.10.3.
So I close this.

s.boot;
Pbind().play;
Window().front; // and do Cmd-. when window is in front
@adcxyz adcxyz closed this Jun 18, 2015
@muellmusik

For the future, it would be IAC very helpful to have user configurable menus in sclang, for standalones as well as general use. This should contain CmdPeriod I think. Again if there's a concern about that, it could be removable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment