Hi,
I am new to this forum and hopefully this question has not been asked before…
I have been using a Teensy 3.2 to read 4 push buttons (using internal pull-ups grounded by a button press) and convert the button presses into USB keystrokes. This is used on a device that is running a stripped-down version of Windows XP SP3 (I have little control of this). The application has been, and still works fine.
The problems arise when this code is run on a Teensy 4.0. Initially, if one button is pressed, the intended keystroke is not sent to the device running the stripped-down version of XP but works fine running on a “normal” Windows XP SP3 computer. When sniffing the USB buss on the problem computer, we see that, when we physically press a button that the key press is not sent, however, when we physically release that same button, a release for that key is sent. In addition, if two buttons are physically pressed and then released simultaneously, both keystrokes are sent and then released normally. As kind of a “hacky” fix, I got it to accept keystrokes on the 4.0 by sending keyboard press and release information twice as follows:
Press:
Keyboard.set_modifier(0);
Keyboard.set_key2(KEY_2);
Keyboard.send_now();
Keyboard.send_now();
Release:
Keyboard.set_modifier(0);
Keyboard.set_key2(0);
Keyboard.send_now();
Keyboard.send_now();
Or…
Keyboard.print("12"); (drops the “1”)
Both of the above examples send a single “2” character on the stripped-down version of Windows XP or TWO characters on the “normal” Windows XP computer. I also have to send 2 releases for the problem system.
I could live with that, but, I also need to send a “return” character to the “Start Windows Normally” prompt on start-up if the stripped-down Windows XP computer was shutdown improperly. Again, this works fine on the “normal” XP computer and when using the Teensy 3.2 on either system.
I am using the following settings:
Board: “Teensy 4.0”
USB Type: “Keyboard”
CPU Speed: “600 Mhz”
Optimize: “Faster”
Keyboard Layout” “US English”
Any help to get this working on the Teensy 4.0 would be greatly appreciated.
Thank You.
-Nick.
I am new to this forum and hopefully this question has not been asked before…
I have been using a Teensy 3.2 to read 4 push buttons (using internal pull-ups grounded by a button press) and convert the button presses into USB keystrokes. This is used on a device that is running a stripped-down version of Windows XP SP3 (I have little control of this). The application has been, and still works fine.
The problems arise when this code is run on a Teensy 4.0. Initially, if one button is pressed, the intended keystroke is not sent to the device running the stripped-down version of XP but works fine running on a “normal” Windows XP SP3 computer. When sniffing the USB buss on the problem computer, we see that, when we physically press a button that the key press is not sent, however, when we physically release that same button, a release for that key is sent. In addition, if two buttons are physically pressed and then released simultaneously, both keystrokes are sent and then released normally. As kind of a “hacky” fix, I got it to accept keystrokes on the 4.0 by sending keyboard press and release information twice as follows:
Press:
Keyboard.set_modifier(0);
Keyboard.set_key2(KEY_2);
Keyboard.send_now();
Keyboard.send_now();
Release:
Keyboard.set_modifier(0);
Keyboard.set_key2(0);
Keyboard.send_now();
Keyboard.send_now();
Or…
Keyboard.print("12"); (drops the “1”)
Both of the above examples send a single “2” character on the stripped-down version of Windows XP or TWO characters on the “normal” Windows XP computer. I also have to send 2 releases for the problem system.
I could live with that, but, I also need to send a “return” character to the “Start Windows Normally” prompt on start-up if the stripped-down Windows XP computer was shutdown improperly. Again, this works fine on the “normal” XP computer and when using the Teensy 3.2 on either system.
I am using the following settings:
Board: “Teensy 4.0”
USB Type: “Keyboard”
CPU Speed: “600 Mhz”
Optimize: “Faster”
Keyboard Layout” “US English”
Any help to get this working on the Teensy 4.0 would be greatly appreciated.
Thank You.
-Nick.