Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently May 18th, 2024, 6:58 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Key Modifier question
PostPosted: January 23rd, 2018, 12:18 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
I set up Key Press Triggers for a program but i need more keys so i use the modifier option.
The problem is that when i use for examle the H key, and want to use and other key with CTRL+H
the function on the button that has only the H as trigger also gives the action.

That means that i can only use the H or the CTRL+H but not together on the same page...
Am i doing something worng maybe?

Ad

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Key Modifier question
PostPosted: January 24th, 2018, 11:55 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Control-H shows the history in most browsers so is best avoid anyway.

But that said, it should still work.

I'd check the trigger carefully as I have found that sometimes if you switch from the trigger to the action tab it doesn't always register the trigger settings correctly.

Also ensure that you have set up individual triggers for each Key Press rather than a multi-trigger.

Lastly, build a simple prototype to eliminate whether something in the larger publication is affecting the it.

</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: Re: Key Modifier question
PostPosted: January 25th, 2018, 7:04 am 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Hi Mack,

I found the problem i had with the modifiers.
When you use a modifier you can't use that same key without modifier.
CTRL+F works good, ALT+F also and SHIFT+F is then the third trigger i can use with the letter F.
The plain letter F without any modifier can't be used because that keystroke will always be active when i use one of the keystrokes with modifier.

I use the stream Deck form Elgato to control a program and therefor i need a lot of shortcuts.
It works well now.

Ad

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Key Modifier question
PostPosted: January 25th, 2018, 9:59 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Okay, I think you must be referring to Opus Executables - the post above is for HTML5 actions that do work.

But again, you can also do it for executables, but you need to use custom event handlers using OpusScript. The code is as follows:

Code:
//Register Event Handles for Key Down and Up
myKeyEventDown = this.RegisterEventHandler("keydown", this.checkKeypressDown);
myKeyEventUp = this.RegisterEventHandler("keyup", this.checkKeypressUp);

//Global variable to track if a modifier key was pressed first
myModifierKey = "";

//function that converts acsii keycode of key down into action.  Note that letter codes use uppercase values.
function checkKeypressDown(e) {
   var keyCode = e.key;
   
   switch (keyCode) {
   //These three cases simply set the modifier value if the key down detects them first.
   case 16:
      myModifierKey = "shift";
   break;
   case 17:
      myModifierKey = "control";
   break;
   case 18:
      myModifierKey = "alt";
   break;
   
   //The following cases trigger actions when a key down is pressed.  The subsequent IFs check whether a modifier key is already set for the current key down event.
   case 72: //H
      if (myModifierKey == "control") F1.Hide();
      if (myModifierKey == "") F4.Hide();
   break;
   case 83: //S
      if (myModifierKey == "alt") F1.Show();
      if (myModifierKey == "") F4.Show();
   break;
      break;
   case 82: //R
      if (myModifierKey == "shift") F1.Rotate(45);
      if (myModifierKey == "") F4.Rotate(45);
   break;
   }
}

//function that occurs on keyup.  It resets the global modifier key.  IE the control,alt, shift key has been released.
function checkKeypressUp(e) {
   var keyCode = e.key;
   
   if (keyCode == 16 || keyCode == 17 || keyCode == 18) myModifierKey = ""
}



You can also download an example from our website using the following code: keyevent@digitalgrapevine.info

And ASCII Key codes can be found here: http://www.asciitable.com/

</mack>

NOTE: This code will work for Opus Executables not HTML5 publications. However, JavaScript has its own powerful event handling with full support for key triggers plus some excellent new functionality in development to handle multi-language, cross device issues.

_________________
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


For this message mackavi has been thanked by : Ad Mulders


Top
 Profile Visit website  
 
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 5 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