Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently April 22nd, 2025, 12:33 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Script question: How to separate F10 from Shift + F10?
PostPosted: March 21st, 2005, 4:51 am 
Offline

Joined: March 9th, 2005, 9:42 am
Posts: 6
Location: Christchurch, New Zealand
Hi All,

I can use F10 (normally reserved) to navigate to a page using:
if (IsKeyPressed("Shift"))
...and I can also use Shift + F10 to navigate to anther page using:
if ((IsKeyPressed("Shift"))&&(IsKeyPressed("F10"))).

My difficulty comes when I am trying to script BOTH of these on one page; there seems to be something amiss with my nesting.

If somebody could help I would be most appreciative,

_________________
Lycos
Opus Pro 4.5
Window XP


Top
 Profile  
 
 Post subject: Catching Shift and Shift F10
PostPosted: March 21st, 2005, 6:24 am 
Offline

Joined: February 4th, 2005, 5:59 am
Posts: 81
Location: Bristol, UK
Hi Lycos,
I've had a go at this - and I have what appears to be working. :D

As usual, any improvements/error-checking etc welcome from you experienced OpusScripters out there!

Cheers

Melanie

Code:
function checkshiftf10()
{
while (true)
   {
   if (IsKeyPressed("F10"))
      {
      if (IsKeyPressed("Shift"))
         {
         GotoPage("ShiftF10page");
         }
      else
         {
         GotoPage("F10page");
         }
      }
   else {}
   wait(0.1);
   }   
}


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

_________________
Win XP, 3.4 HT P4, 1GB ram, Nvidia Geforce 6610 XL, DirectX 9.0c
Opus Pro 04 XE version 4.50
Opus 2.81


Top
 Profile  
 
 Post subject: Thank you, yes, this works great.
PostPosted: March 21st, 2005, 8:42 am 
Offline

Joined: March 9th, 2005, 9:42 am
Posts: 6
Location: Christchurch, New Zealand
Thank you Melanie, brilliantly simple; I was WAY off on a tangent (you know how it can be sometimes...)

Cheers,

_________________
Lycos
Opus Pro 4.5
Window XP


Top
 Profile  
 
 Post subject: logic's OK
PostPosted: March 21st, 2005, 8:59 am 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
Hi Melanie,
Your conditional logic is good.
you can leave out the last else{}.
it doesn't do anything.
cheers
Paul


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group