First time here? Check out the FAQ!
x

!Keydown and switches

0 votes
492 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, 2017 in Capytalk & Smalltalk by domenico-cipriani (Master) (3,110 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, 2017 by ssc (Savant) (128,120 points)
selected Jun 2, 2017 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, 2017 by jeffhinton (Practitioner) (580 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, 2017 by ssc (Savant) (128,120 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...
...