Upcoming Events

Jason Kelly Johnson will be running a one-day intensive Firefly/Arduino Workshop "RESPONSIVE BUILDING FACADES" on July 27, 2012 in San Francisco (as a part of the Architect's Newspaper "Art and Science of Building Facades" Symposium.) Register here.

*Read Jason's Hardware Recommendations blog post for 2012-13 Firefly Workshops.  

Are you teaching or participating in a workshop that is using Firefly?  Let us know about it and we'll feature it here on the Firefly website! (info@fireflyexperiments.com)

Discussions > "Is Key Pressed" half working ?

Hello together !

I wan tto make my progamm interactive and I am using the "Is key Presed" function.
Well is working well together with the timer, only the problem is that the command line of
rhino is "half listining" too and writes the pressed key in rhino command line too...
( Well if I use F1-F12 Keys its okay beacasue they have no function in my rhino settup)
Is there a possibilty to make rhino not listing to my key inputs ( Like Keys 1-8 )

Thansk Raph

March 30, 2012 | Unregistered CommenterRaphael Lang

Hi Raphael,
Unfortunately, at the moment, I don't know how to override Rhino's keypressed listening functions. This would actually open up a lot of difficult issues (when to silence or wakeup the listening features?) I'll think about it, and see if I can come up with something... but I don't think it is possible at the moment.
-Andy

March 31, 2012 | Registered CommenterEditor

thanks... how I can realise a toggle key function ? with the "key press" I need to acces a value in a list with the key numbers od the key so I need to hold in the stack the "key value" ?...

thanks !

Raphael

April 2, 2012 | Unregistered CommenterRaphael Lang

Hi Raphael,
If I understand your question correctly, this shouldn't be too difficult. Basically, you'll want to create a list of 'keys' that you want to press which will locate a specific item in a list. You'll also want to create a list of items you want to select from (let's say it's a list of numbers). You want both of these lists to have the same number of values, and the order of the key list should match the order of the number list. Using a Dispatch component, you can feed the list of numbers into the L-input and the output of the IsKeyPressed component into the P-input. The A-output corresponds to the items in the list that matched a true in your boolean pattern. So, when you press one of your keys down, it will go into the list and return the values that are currently associated with that position in the list out of output A. I'm not sure I explained it very clearly, but it's actually pretty straight forward. Let me know if you need any additional help.
-Andy

April 3, 2012 | Registered CommenterEditor

Hi Andy
Firstly Thankyou for this option.
I am making a small project where I am using almost 30 odd keys to do certain kind of functions.
had two questions regarding the same :

1. Is there a way to have a remote like functionality ? : instant activation but a delayed deactivation : just like a TV remotes here the channel number displayed remains even after instantly switching.
2. As I am working with 30 different "if key pressed " commands with 20 Millisecond timer each is slowing down the script. As there are a ton of functions attached to the Boolean of a key being pressed. Is there a way to speed up things ? Optimising ? Using a python script would be faster ?

Any help would be appreciated.
Thanks again for firefly
Dhruv

May 10, 2015 | Unregistered CommenterDhruv