Hello Ventuzians!
THE FORUMS ARE CLOSED!

Please join our discord server HERE!! << click me :D

We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server

Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!

Caps Lock State Node?

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

User avatar
shermanpat
Posts: 122
Joined: 21 Feb 2012, 22:03
Location: SLC Ut USA

Caps Lock State Node?

Post by shermanpat » 18 May 2016, 15:08

Was trying to us the Caps Lock button as a bool to change some controls in a program with feedback on the keyboard for the user. But I didn't see any node that tell me what the state of the Cap Lock key is. Am I just forgetting about a node?

Thanks
-Sherman
Meru Interactive

User avatar
Chris
Posts: 108
Joined: 14 Aug 2012, 09:10
Location: UK

Re: Caps Lock State Node?

Post by Chris » 18 May 2016, 20:20

Hi Sherman,

Connect a keyboard node to the toggle input of a toggle node. Obviously this is dependant on the current state of the caps lock key during scene start up, but that the only way to get the cap locks key to fire a bool, unless you use a script.

Chris

User avatar
shermanpat
Posts: 122
Joined: 21 Feb 2012, 22:03
Location: SLC Ut USA

Re: Caps Lock State Node?

Post by shermanpat » 19 May 2016, 07:17

That is what I did for a work around which can break depending on what the state is at time of opening the scene. But I can work with that for this scenes needs, was just looking to use the light on the keyboard as a notice for a toggle of a Cut or Fade animation types.
-Sherman
Meru Interactive

User avatar
Chris
Posts: 108
Joined: 14 Aug 2012, 09:10
Location: UK

Re: Caps Lock State Node?

Post by Chris » 19 May 2016, 08:12

try this ;)
Attachments
CapsLockState.vza
(15.83 KiB) Downloaded 250 times

User avatar
Chris
Posts: 108
Joined: 14 Aug 2012, 09:10
Location: UK

Re: Caps Lock State Node?

Post by Chris » 19 May 2016, 08:16

Just thought, you'll need to connect a scene event node to the script method to recheck the caps lock on scene start up ;)

User avatar
shermanpat
Posts: 122
Joined: 21 Feb 2012, 22:03
Location: SLC Ut USA

Re: Caps Lock State Node?

Post by shermanpat » 20 May 2016, 23:52

Thanks for sharing, will test it out in a few days.
-Sherman
Meru Interactive

User avatar
shermanpat
Posts: 122
Joined: 21 Feb 2012, 22:03
Location: SLC Ut USA

Re: Caps Lock State Node?

Post by shermanpat » 24 May 2016, 14:26

So simple, thanks.

I never know where to start when trying to create scripts like this. But when I see them it makes good sense, gotta work on my scripting know how!
-Sherman
Meru Interactive

User avatar
Eric_RD
Posts: 103
Joined: 04 Jun 2014, 14:01
Contact:

Re: Caps Lock State Node?

Post by Eric_RD » 31 May 2016, 12:00

You don't even need a Script for that:

Create an Int expression node with the following expression
Convert.ToInt32(System.Console.CapsLock)
this node outputs: 0 or 1

Or a String Expression with
System.Console.CapsLock.ToString()
output: True or False

Everytime you change any of the inputs of these expressions they give you the current CapsLock state.
You can connect both expression outputs to a Bool Node to cast it into a boolean value.

User avatar
Chris
Posts: 108
Joined: 14 Aug 2012, 09:10
Location: UK

Re: Caps Lock State Node?

Post by Chris » 31 May 2016, 16:06

This is a great point Eric!

I always over look the fact that these things can be accomplished in the expression nodes.

Can you call on any namespace from the expression nodes?? or is it just certain ones from the .net library??

Cheers
Chris

User avatar
shermanpat
Posts: 122
Joined: 21 Feb 2012, 22:03
Location: SLC Ut USA

Re: Caps Lock State Node?

Post by shermanpat » 31 May 2016, 20:14

That sure makes it simple to just do that in a expression node. Thanks for sharing.
-Sherman
Meru Interactive

Post Reply