Page 1 of 1

Keystroke Input with Shift and Control

Posted: Sat Dec 31, 2011 11:05 am
by florian
A user asked:
how can you create translators on keystroke combinations like Shift+Ctrl+D ?

Re: Keystroke Input with Shift and Control

Posted: Sat Dec 31, 2011 11:08 am
by florian
The incoming Keystroke Action can only capture one key at a time (we will change this in future).

For key combinations, you will need to use global vars that capture the current modifier key status. Here is an example how to track Shift and Control:

Code: Select all

Translator 0: Shift Down
Incoming: Keystroke Down "Shift"
Rules: gs = 1
Outgoing: None

Translator 1: Shift Down
Incoming: Keystroke Down "Shift"
Rules: gs = 0
Outgoing: None

Translator 2: Control Down
Incoming: Keystroke Down "Control"
Rules: gc = 1
Outgoing: None

Translator 3: Control Up
Incoming: Keystroke Up "Control"
Rules: gc = 1
Outgoing: None
Now if gs is one you have currently Shift pressed, and the same for Control and gc.

Add a translator for Shift-Control-D:

Code: Select all

Translator 4: Shift+Control+D
Incoming: Keystroke "D"
Rules:
 if gs==0 then exit rules, skip outgoing action
 if gc==0 then exit rules, skip outgoing action
Outgoing: MIDI 90 40 7F
The Rules tell the translator to not be executed if either gs or gc are 0, i.e. not down.

Florian

Re: Keystroke Input with Shift and Control

Posted: Wed Jan 04, 2012 9:37 pm
by orchesterwart
Hi!

2 little changes an then works GREAT!

THX for the input!

Greets, Orchesterwart

Code: Select all

Translator 0: Shift Down
Incoming: Keystroke Down "Shift"
Rules: gs = 1
Outgoing: None

Translator 1: Shift Up
Incoming: Keystroke Down "Shift"
Rules: gs = 0
Outgoing: None

Translator 2: Control Down
Incoming: Keystroke Down "Control"
Rules: gc = 1
Outgoing: None

Translator 3: Control Up
Incoming: Keystroke Up "Control"
Rules: gc = 0
Outgoing: None