Allow Suppressed Keystrokes

Hi, 

New user here. Loving the program and capabilities it's opening up on my computer and DAW via midi controllers so far. 

One simple question: Is there a way to ALLOW keystrokes, even in BMTP? 

For context, I'm trying to assign a midi message to Alt(Tab), so with one button I can tab across various screens and programs (I'm a coder as my day job so tabbing thru terminals, IDEs, etc.). The issue comes whenever I tab to the BMTP screen, as we know it suppresses keystrokes when the main window is active. If I could selectively decide to override this behavior in some way so I could still alt tab, or run whatever keyboard combo, even on the main window it would be amazing! 

Your advice is greatly appreciated. 

So I found the option to disable the suppress functionality. Still wondering if there\'s a way to write a rule or something to set it selectively for a translator. Also, as a follow up, are there any docs/guids on writing Rules and the synatx used for them? I\'m wondering how far we can take the decision trees, and can we use things like loops or even switch statements? Thanks!

Hi,

As you discovered you do have an option to enable or disable outgoing keystrokes, however this cannot be done programatically; only through the menus.

 

As far as documentation, you can use the help menu or press F1 to get the Bome MIDI Translator Pro user manual.

There are no loop or case statements in the language, however there are other ways to accomplish this.

For loops, you use timers. You set a global variable to a value and then start a repeating timer for how many times you want an action to repeat.  

On the incoming timer, you decrement the global variable and then use the new value to determine which iteration your are at and what you want to do for that iteration. 

 

For case statements, again you set a global variable and a one-shot timer. The global variable represents the "case". Then there are several translators that fire on the incoming timer.  In rules, you look at the global variable within each translator and only fire if it is the target value.

Attached is a project file that shows both. 

The first preset handles a loop situation with global variable ga as the loop iteration.

The second preset handles a case situation where only the target translator fires an output message depending on the value of gb.

 

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

 

 


Attachments:
1599406685714_Loop-Case-Examples-2020-09-06.bmtp

Hi Steve,

 

Thanks a lot for the response! 

 

New Question: I have an alt-tab macro for a midi button. Basic concept is that, with one midi button, I can alt tab thru all the screens I have up (yay). The way I'm accomplishing this is by using timers as "event hooks" so to speak, similar to as described in the manual and used above. It works great except for a couple programs/screens primarily all my VScode instances, and my task manager.

While not a huge problem when not coding/using those programs, the main reason I came up with this idea is to alt-tab thru those EXACT things. So I'm hoping you could give me some advice on whats going wrong here, i.e., is this a feature somehow (certain programs just eat the midi message somehow), or a bug, specifically in my approach. I've attached screens of the logs and explained a bit of the timer handling process below. Any advice would be appreciated.

On my 1st timer:

  - OA = Key down: Alt

  - OA = None, set global variable "gg" to 1 (used for tracking if alt key is down or not)

  - OA = Physical Keys: Tab, delay:200ms (helps me not spam myself into oblivion)

  - OA = One-shot timer "Alt Key Down Loop": 2000ms

 

On "Alt Key Down Loop":

  - OA = Key Up: Alt

  - OA = Key Up: Tab (because paranoid)

Thanks,

Thunder.


Attachments:
![](upload://6bwSowmOeDiQAzAMvcRro9967yu.png)

OA - Outgoing Action btw :slight_smile:

Could you post your project file. I’ll have a look.

I would not put a conditional for 3.6. If nothing has happened in 2 seconds the key should come up. Each time you trigger the timer, it restarts the clock. In the current scenario, if for some reason, gg gets stuck in the down position (gg=1) and the timer is done before the next note comes in, the alt key will never come back p and the second timer will not retrigger and gg will never be reset to 0.

 

I would recommend you do not send extra tab up key. Trust that it will happen in 3.3.

I noticed you actually had the tab key up after the alt key which might confuse things. I'm not sure if Windows know how to handle multiple key ups without a key down.

With your logic, if more incoming notes come within the 2 second clock nothing happens (the original timer resets the second timer again so if you get more notes in it will keep delaying the second timer outgoing action.

 

 

Took your advice on the tab key up, that definitely introduce a bug I couldn\'t figure out. The conditional is just to assign gg=0. As you stated the Alt key should come up either way, and I\'m relying on the timer refreshing each midi event to control it.

Here is the text version of the preset:

[x] Preset 3: Alt Tab

[x] Translator 3.0: On Midi Event
Options: swallow
Incoming: MIDI 90 31 pp
Outgoing: One-shot timer \"Alt Key Down\": 0 ms delay

[x] Translator 3.1: Alt Key Down
Incoming: On timer \"Alt Key Down\"
Rules: if gg==1 then exit rules, skip Outgoing Action
Outgoing: Key down: Alt

[x] Translator 3.2: SET KEY DOWN VAR
Incoming: On timer \"Alt Key Down\"
Rules: if gg==0 then gg=1
Outgoing: (none)

[x] Translator 3.3: Tab Key
Incoming: On timer \"Alt Key Down\"
Rules: if gg==0 then exit rules, skip Outgoing Action
Outgoing: Physical Keys: Tab, delay:200 millisec

[x] Translator 3.4: Timer Loop
Incoming: On timer \"Alt Key Down\"
Outgoing: One-shot timer \"Alt Key Down Loop\": 1000 ms delay

[x] Translator 3.5: Alt Key Up
Incoming: On timer \"Alt Key Down Loop\"
Rules: if gg==1 then gg=0
Outgoing: Key up: Alt

Annnnd here's my stripped down preset. Using an akai fire btw, and the issue of NOT being able to tab out of VScode still exists. Again, appreciate you looking into this.


Attachments:
1599459388248_Akai-Fire-Copy.bmtp

Hi,

As far as I can tell, task manager does not like virtual ALT Key. You can use your project to Alt Tab past task manager but if you stop on task manager, you cannot use it to move away from task manager. I suspect task manager is bypassing the normal keystroke system and instead looking at raw keystroke from a physical keyboard.

I made one change to your project however. I disabled translator 1.2 and instead added the rule gg=1 in 1.1.

I always try get do stuff with the minimum amount of translators needed. You can also put no delay at project open if you would like or setting of global variables instead of 1 second. I didn't change this in the attached file, however.

 

 

Attached is the project.

 

 


Attachments:
1599506610231_Akai-Fire-Copy-sjc.bmtp

Thanks Steve. What do you think about moving this alt tab functionality to an ahk (autohotkey)? I haven't tried it yet but do you think we'd run into the same problem given it the type of keystroke message it will emit?

In fact, in general what do you think about writing AutoHotkeys to extend a lot of would be functionality on windows systems? I'm thinking that, using the Bome Software as a router, I can trigger hotkeys that can encapsulate deeper functionality.

Going further, if I can figure out a way to translate MIDI message directly via AHK, I'm thinking I can use bome software to manage presets/banks of functionality and use AHK for lower level/more complicated tasks.

Again, thanks for the feedback. Really enjoying looking into all the different workflows in coding, DAWs, and even daily productivity. Your software turns something like an Akai Fire into an cheap way to extend and encapsulate so much, and it's looking like the Bome + AHK combo is a cheat code for windows automation and productivity.

You can do things with MIDI and keystrokes in AutoHotkey but the MIDI processing is not nearly as efficient as the Bome MIDI Translator engine. I AHK occasionally but only for things like suppressing incoming keystrokes which Bome MIDI translator cannot do. My guess is that if things are not working with Bome MIDI Translator, the likelihood of them working with AHK will be low unless you have AHK use a DLL call that calls a Windows API function instead of sending a hotkey.