First time here? Check out the FAQ!
x

!Keydown and switches

0 votes
75 views
hello, I would like to know if there is a caytalk expression that I could use to "turn on" a switch (for example !Sw01) with a !KeyDown hit, and once turned on, leave it in its "1" state.

I have in mind to build up a real time step sequencer and that would be really useful.

thanks for your help
asked Jun 1 in Capytalk & Smalltalk by domenico-cipriani (Practitioner) (840 points)

3 Answers

0 votes
 
Best answer

You could control !sw01 both with the keyboard and with the VCS using a TriggeredSoundToGlobalController set up like this:

answered Jun 1 by ssc (Savant) (57,610 points)
selected Jun 2 by domenico-cipriani
Thanks! This is what I need!
0 votes
!KeyDown asToggle I believe is what you're looking for.  A second !KeyDown would turn it off.
answered Jun 1 by jeffhinton (Practitioner) (350 points)
My question is different, how can that !keydown also turn on a !sw01?
I would like to have a !sw01 that I can turn on both with a mouse click and with a ! keydown
0 votes

You could use Jeff's answer

!KeyDown asToggle

as the Value in a SoundToGlobalController and set the GeneratedEvent to

!sw01

answered Jun 1 by ssc (Savant) (57,610 points)
But then can I also turn the !sw01 on and off with a mouse click? If don't remember bad, I cant modify a generated event from the VCS...
...