Teensy 3.2 - keyboard press only working in the selected/active program

Status
Not open for further replies.

DrAlbany

Member
Hi Guys...,

I've created a keyboard with illuminated buttons, when a button is pressed it illuminates the LED then sends the keyboard command.

My problem, it works, but the keys are only being seen by the selected program and not the system overall. (Windows 10 64bit)

If I press the same keyboard combination on a normal keyboard the key press work as I want them to, no matter which program I have selected/active.

I'm using OBS - open broadcast system to send an output to a big screen at a soccor ground, so when I press CTRL-ALT-F1 a certain graphics is selected, likewise CTRL-ALT-F2 a video is played of a recent goal... I can be in another program and press the keyboard combinations and it will still affect OBS, as in... it will change scenes.

When I do the same with my prototype keyboard it doesn't only the selected program see's the key presses, so only works when OBS is the selected/active program.

Any Ideas how I can get the Teensy to send the keyboard keys to windows and not just the active program?

Code snipped
Code:
  if (button1.risingEdge()) {
    //Keyboard.println("B1 release");
    Keyboard.press(MODIFIERKEY_CTRL);
    Keyboard.press(MODIFIERKEY_ALT);
    Keyboard.press(KEY_F11);
    Keyboard.releaseAll();
  }

Here is the keyboard and an example of what I am doing with it.
https://youtu.be/wY4b77sp_0M

Thanks in advance :)

Steve
 
I am not knowledgable on HID and may be talking complete rubbish, but not sure if you can do a "system-wide hot-keys". I would think the OBS must be capturing the keyboard input somehow.
If you search on their Forum for "keyboard" there are two similar examples; one with a user wanting to send keystrokes with Vb script and another using the "ROCCAT Power-Grid". Both fail and I cannot see any replies, but it might be worth posting something.

regards
Robert
 
Hi Robert...,

Thank you for your time.

It works with a standard keyboard... After doing a bit more digging I think the problem is the HID for the Teensy is sending the characters to the keyboard buffer rather than sending a global key command to windows.

Thanks again.

Steve
 
Sorted...
I used a different programming language I am familiar with to read the scan codes... both the keyboard and the Teensey produced the same scancodes....

I introduced a delay of 500ms before releaseall() and it works.

Thanks again.

Steve
 
Glad you got it working. Out of interest I just got home and checked with a little program I had been using to help in debugging keyboard mouse simulation called "Showtime". It gets the keyboard press regardless of focus, which ties up with it just being a timing issue.

Robert.
 
Status
Not open for further replies.
Back
Top