Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 9:14 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Using IsKeyPressed
PostPosted: January 22nd, 2008, 2:06 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

I'm trying to use IsKeyPressed to add a modifier ("Shift" key), through scripting, to a mouse over trigger (which doesn't seem to have the standard modifier choices in the dialog box). I must be doing something wrong, since whichever variation of script used doesn't work.

I've attached a sample IMP file and would appreciate any help in getting it to work (possibly, the mouse over trigger is not able to accept modifiers?).

Kind Regards,


You do not have the required permissions to view the files attached to this post.

_________________
Stephen


Top
 Profile  
 
 Post subject:
PostPosted: January 22nd, 2008, 3:12 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Stephen,

I would suggets looking at it a different way:

1. create a page variable called objectOver and set value to 'x' (without speech.

2. Create a page trigger of Key Press "shift" and add a script action with the following code:

if (objectOver != 'x')
{
eval(objectOver+'.Rotate(5)')
}

This basically checks that the var objectOver isn't 'x' and then excutes the value stored in the variable.

The value in this variable is created by:

1. Add a mouse over trigger to an object (say a vector) and add the following code:

objectOver = this.GetName()

2. Add a mouse exit trigger to the object and add the following code:

objectOver = 'x'

This will basically set the objectOver variable to the name of the object (see below) when over and reset to 'x' if mouse out. The page polling trigger for key press will be checking in the background for the objectOver variable and rotate which every object name it is passed.

NOTE: YOU MUST USE OBJECT NAMES WITHOUT SPACES IE vector1 not vector 1!!!!!

Simple add te same code to all the objects on the page and the name will be passed to the variable which the key press with then check. Add additional key press triggers with the same code but different action IE ALT is rotate anticlockwise, etc.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: January 22nd, 2008, 4:30 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Mack

Thanks for this very interesting piece of scripting, which I experimented with. It provided some very good ideas.

I finally got the IsKeyPressed working with the arrow keys (can't seem to get the "Shift" key to work).

I've attached the IMP. The newest scripting is for the second line.

I still need to tweak it somewhat.

Kind Regards,


You do not have the required permissions to view the files attached to this post.

_________________
Stephen


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group