AutoHotkey Community

It is currently May 27th, 2012, 12:06 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: February 11th, 2011, 2:21 am 
Offline

Joined: August 17th, 2006, 3:26 pm
Posts: 68
I'm using a Tipro matrix keyboard for shortcuts. But it never really worked when using combinations of ALT, CTRL and Shift. So I thought I would ditch the internal keyboard memory (leaving the keys unassigned) and use AHK instead. But is it possible to do that at all? I guess I would need to detect the scancodes or whatever. I already took a look at AKHID and Other HID Info
but when pressing a key nothing is shown. Did I go the wrong route maybe?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2011, 5:52 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
You didn't specify the Tipro model, but if it is a programmable matrix keyboard I think you are using it wrong.
As I understand it, the purpose of these keyboards is to compress several keystrokes into a single push.
Trying to add control, shift or alt is kinda silly.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2011, 8:06 am 
Offline

Joined: August 17th, 2006, 3:26 pm
Posts: 68
Hey Leef,

it's a MID 96 (96 keys). I use it to trigger hotkeys in my music sequencer and of course these also consist of ALT, CTRL and SHIFT.
The problem is, If I want to make use of the keyboard I have to assign
something to the keys so that my sequencer can recognize it (unless I find a way to trigger the scancodes and assign my commands directly in AHK).
This means, I need to add like 96 different keys to make the device usable in Windows. At the moment I'm using a hotstring "F13 + 001, 002, etc... for each key. But this causes issues.


Cheers,

Stevie


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2011, 9:08 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
Here is a link to a prior post, with a key history script
http://www.autohotkey.com/forum/viewtop ... 399#352399
It isn't much, just a wrapper around existing commands.

You can use this script to see if the matrix puts out 'scan codes'
My guess is that this is doubtful, but it is worth a try.


I am not familiar with 'music sequencer' other than having heard the term.
Can you give a quick definition?

:arrow: I'm interested in making some suggestions & script ideas, but need a little more background.

Would you go into some detail about the "issues" involved with F13 + 001 etc? I'm referring to >>But this causes issues.

Also, how do you program the matrix? I looked for info, but came up short. Perhaps Tipro have PDF that explains this, but I couldn't find it.

Can you describe what you might want to do with 96 buttons?
What would would a column or row contain?
Would the keys dynamically 'change function' ?

I work with electronics so I can theorize or understand how the matrix works.
But what I don't understand is its purpose.

For comparison, the closest analogy I have is the newer fast-food cash registers.
The cash tenders translate what you verbally request into button-presses of available menu items.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2011, 3:57 pm 
Offline

Joined: August 17th, 2006, 3:26 pm
Posts: 68
Hey Leef,

thanks for your reply.

Leef_me wrote:
Here is a link to a prior post, with a key history script
http://www.autohotkey.com/forum/viewtop ... 399#352399
It isn't much, just a wrapper around existing commands.

You can use this script to see if the matrix puts out 'scan codes'
My guess is that this is doubtful, but it is worth a try.


Yes, I already tried that manually with no effect :(


Quote:
I am not familiar with 'music sequencer' other than having heard the term. Can you give a quick definition?


Yeah sure, a music sequencer is pretty much the same as a video editing software. You have a timeline with a lot of events (these can be audio clips or MIDI data).

This video shows the basics and also the part with key commands and macros where I need the Tipro for:
http://www.youtube.com/watch?v=hGhqBVrfQF8

Quote:
:arrow: I'm interested in making some suggestions & script ideas, but need a little more background.


Tell me if the info above is sufficient for you.

Quote:
Would you go into some detail about the "issues" involved with F13 + 001 etc? I'm referring to >>But this causes issues.


Well, what I do is, I assign to every of the 96 keys the F13 + 001... hotstring. This info is written into the internal memory of the keyboard.
Then, in my AHK script, I assign the actual key command that will trigger
a function in Cubase.

Here's a snippet of my code:

Code:
SetKeyDelay, 20, 100

F13::
  Input Enterpad_key, L3 I T3
  if IsLabel(Enterpad_key)
    gosub %Enterpad_key%
return

;-----------------------------------------------------------------------1-----
;Add MIDI Track
001:
Send !+^m
Return

097:

;-----------------------------------------------------------------------2-----
;Add Instrument Track
002:
Send ^!+i
Return

098:


As you can see, I also double assigned the keys. Every key has a second function that can be switched via the "choose layer" key. Not all are assigned, though.

The problem is now, that the last digit of the number usually "gets thru" and is interpreted by Cubase instead of the actual hotkey. So when I send F13+001, which should add a MIDI track, sometimes
ALT+CTRL+SHIFT+M is triggered, and sometimes the "1" of 001 leaks thru. It's a pretty unpredictable behavior and I also tried to circumvent it by adding several delay parameters. But nothing really helped, since this is all burned into the keyboard's memory.


Quote:
Also, how do you program the matrix? I looked for info, but came up short. Perhaps Tipro have PDF that explains this, but I couldn't find it.


There is a program called "Change Me" that will take care of that.
Image

And here is the full guide as PDF:
http://www.tipro.si/download/FREE_UM_5_6.pdf

Quote:
Can you describe what you might want to do with 96 buttons?
What would would a column or row contain?


It will mostly be hotkeys that trigger cubase functions. Some might also be AHK macros which involve MouseMove (for functions that cannot be assigned to key commands) or even popup up menus that will show several functions to chose from.

That's how it looks at the moment:
Image

Quote:
Would the keys dynamically 'change function' ?


No, some keys will have two layers, but that's it.

Quote:
I work with electronics so I can theorize or understand how the matrix works. But what I don't understand is its purpose.
For comparison, the closest analogy I have is the newer fast-food cash registers. The cash tenders translate what you verbally request into button-presses of available menu items.


You hit the nail! That's it. behind every key is a complex task that consist of a single shortcut, macro, mouse movement or popup menu.
A fast-food cash for composers so to say :D

I hope I could give you an understandable insight. If not, feel free to ask!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2011, 7:55 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
Hi Stevie,
Thanks for the info, I have a better grasp.
My head is about to explode for all the info, but I have a better grasp.

>>As you can see, I also double assigned the keys. Every key has a second function that can be switched via the "choose layer" key.

The 'switching' done in the matrix keyboard with the "Multiple layer key", right?

You mean this, right?
Code:
097:

;-----------------------------------------------------------------------2-----
;Add Instrument Track
002:
Send ^!+i
Return

I see you are using string length and time limit. I don't know what delay you have have set for the time between keys.
But according to the manual and the 'T3' in your script, your script should wirk fine, but it doesn't.

Tipro manual wrote:
If the controller is sending codes too fast (this can happen on certain computers) you can select a different Interbyte delay.
This is the time between two consecutive sent codes. The default is 1 ms.


Have you considered using an EndKey ?

Also, I suggest trying this as a diagnostic. The idea is to see how long it takes the keyboard to send the string of keypresses.
Code:
#singleinstance force
SetKeyDelay, 20, 100

; F12:: ; Leef_me used F12 instead of F13
F13::
tooltip, F13
  start:=A_TickCount

;  Input Enterpad_key, L3  I T3
  Input Enterpad_key, L3  I

  end:=A_TickCount
  err:=errorlevel
  delta_t:=end-start
  if IsLabel(Enterpad_key)
  {
    fileappend, pass %delta_t% >|%Enterpad_key%|<%err%`r`n, matrix_log.txt
    gosub %Enterpad_key%
  }
  else
  {
    fileappend, ****fail %delta_t% >|%Enterpad_key%|<%err%`r`n, matrix_log.txt
  }
tooltip,    ; hide tooltip
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2011, 11:03 pm 
Offline

Joined: August 17th, 2006, 3:26 pm
Posts: 68
Leef_me wrote:
Hi Stevie,
Thanks for the info, I have a better grasp.
My head is about to explode for all the info, but I have a better grasp.


LOL, sorry. I wanted to give you the best overview.



Quote:
The 'switching' done in the matrix keyboard with the "Multiple layer key", right?


Yes, it's the key at the bottom left where it says "switch layer".


Quote:
You mean this, right?
Code:
097:

;-----------------------------------------------------------------------2-----
;Add Instrument Track
002:
Send ^!+i
Return


Not quite! The matrix has 96 keys. So it starts again at 97 (= 1).
001 and 097 are the same key.

Quote:
I see you are using string length and time limit. I don't know what delay you have have set for the time between keys.
But according to the manual and the 'T3' in your script, your script should wirk fine, but it doesn't.


Yeah :(

Tipro manual wrote:
If the controller is sending codes too fast (this can happen on certain computers) you can select a different Interbyte delay.
This is the time between two consecutive sent codes. The default is 1 ms.


Ahh! I will set a higher value and test it.

Quote:
Have you considered using an EndKey ?


I didn't know this was possible :o

Quote:
Also, I suggest trying this as a diagnostic. The idea is to see how long it takes the keyboard to send the string of keypresses.


Ok! Will report back. Thanks for your help. Much appreciated!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2011, 11:18 pm 
Offline

Joined: August 17th, 2006, 3:26 pm
Posts: 68
Unfortunately the interbyte delay applies only to PS2, but mine is connected via USB :o


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2011, 11:37 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
>>As you can see, I also double assigned the keys.
>>Every key has a second function that can be switched via the "choose layer" key.
>>Not all are assigned, though.

Code:
;-----------------------------------------------------------------------1-----
;Add MIDI Track
001:
Send !+^m
Return

097:

;-----------------------------------------------------------------------2-----
;Add Instrument Track
002:
Send ^!+i
Return

098:

:?: :arrow: You do realize that pressing key 097 will result in the same action as 002?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2011, 11:58 pm 
Offline

Joined: August 17th, 2006, 3:26 pm
Posts: 68
No I didn't :oops: :oops: :oops:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 12th, 2011, 12:10 am 
Offline

Joined: August 17th, 2006, 3:26 pm
Posts: 68
Okay, I commented out the "097:".
Now I assigned CTRL+A to 001 (usually "select all") and I noticed an alternating behavior here. When first pressing the 001 in notepad,
I can see the written "001", when pressing it a second time, the text is selected and so on... It's always repeating itself. I don't get it...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 12th, 2011, 2:08 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
Stevie wrote:
No I didn't :oops: :oops: :oops:


That's why I asked... I am trying my best to 'cover your back' :wink:

Stevie wrote:
Okay, I commented out the "097:".
Now I assigned CTRL+A to 001 (usually "select all") and I noticed an alternating behavior here. When first pressing the 001 in notepad,
I can see the written "001", when pressing it a second time, the text is selected and so on... It's always repeating itself. I don't get it...


My apologies, I don't comprehend.
There is an option "V" in 'input' to make the received characters visible.
But I can't imagine how this option would be toggled off & on.

Can you post your current script and a synopsis of what you have programmed into the matrix (assuming you made any changes) ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 12th, 2011, 11:48 am 
Offline

Joined: August 17th, 2006, 3:26 pm
Posts: 68
Leef_me wrote:
That's why I asked... I am trying my best to 'cover your back' :wink:

:lol: thanks


Quote:
My apologies, I don't comprehend.
There is an option "V" in 'input' to make the received characters visible.
But I can't imagine how this option would be toggled off & on.



Sorry, let me explain. I assigned CTRL+A to the first key (001)
and executed the modified script. This should result in "select all". The video shows what happened. Keep in mind, I solely pressed key 001 (with a pause of one second in between):

Image

This is the generated logfile of the keystrokes above:
Code:
pass 1529 >|100|<Max
pass 1420 >|001|<Max
pass 1451 >|001|<Max
pass 1482 >|001|<Max
pass 1357 >|010|<Max
pass 1404 >|100|<Max
pass 1372 >|010|<Max
pass 1357 >|001|<Max
pass 1451 >|010|<Max
pass 1498 >|010|<Max
pass 1373 >|010|<Max
pass 1404 >|010|<Max
pass 1451 >|001|<Max
pass 1280 >|100|<Max
pass 16 >|001|<Max
pass 1357 >|010|<Max
pass 1404 >|010|<Max
pass 1310 >|001|<Max



Quote:
Can you post your current script and a synopsis of what you have programmed into the matrix (assuming you made any changes) ?


That's what I'm using at the moment:

Code:
#singleinstance force
SetKeyDelay, 20, 100

; F12:: ; Leef_me used F12 instead of F13
F13::
tooltip, F13
  start:=A_TickCount

;  Input Enterpad_key, L3  I T3
  Input Enterpad_key, L3  I

  end:=A_TickCount
  err:=errorlevel
  delta_t:=end-start
  if IsLabel(Enterpad_key)
  {
    fileappend, pass %delta_t% >|%Enterpad_key%|<%err%`r`n, matrix_log.txt
    gosub %Enterpad_key%
  }
  else
  {
    fileappend, ****fail %delta_t% >|%Enterpad_key%|<%err%`r`n, matrix_log.txt
  }
tooltip,    ; hide tooltip
return

;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; “Ready-to-customize” macros linked to each of the 96 (192) Enterpad keys.
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;-----------------------------------------------------------------------1-----
;Add MIDI Track
001:
Send ^a
Return

;097:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 12th, 2011, 3:11 pm 
Offline

Joined: August 17th, 2006, 3:26 pm
Posts: 68
I could somehow fix it by adding a 100ms delay after pressing F13.
I did this with Change Me. Apparently the Tipro sends keys way too fast
and this causes AHK to misbehave and re-interpret key strokes.
However a 100ms delay is pretty long. But 1s and 100ms are the only available values (imagine, how crazy is that!).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2011, 1:54 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
Your video was "clear as a bell", thank you.

1. Change the matrix so it was 'normal' speed, do delays, no faster.
2. change one line of your script
Code:
; SetKeyDelay, 20, 100

3. try the new script, with the same methods you used for the video.

(I believe you will be posting results with a smiley face)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Yahoo [Bot] and 18 guests


You can post new topics in this forum
You can 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:
Powered by phpBB® Forum Software © phpBB Group