8
By using the make and break commands in Key Number Mode, any
sequence that can by manually entered on a keyboard can be produced
with the USBtoUSB. Use this Key Number Mode to emulate single
keystrokes or combinations such as Ctrl+F1, or Shift+Alt+F5, etc.
Additional Key Number Mode Control Commands
The USBtoUSB features two additional commands for keyboard action.
The first command provides a way to clear the keyboard buffer and is
useful for ensuring that no keys are left in the “ON” state. The second
command allows for the polling of the keyboard status LED states. This
polling command is useful for checking the Shift Lock state, or for making
sure of the Num Lock state before using Num Lock affected keys.
0x38
- USB Buffer Clear Command. Sending the byte 0x38 to the
USBtoUSB Com Port port results in the device’s internal USB keyboard
buffer being cleared. Use of this command ensures that all made keys
currently in the keyboard buffer are released.
0x7F
- Status LED Read Command. Sending a code 0x7F to the USBtoUSB
Com Port results in the return of a character in the range of ASCII
“0” - “7”. The USBtoUSB Com Port response character reflects the
current state of the Scroll Lock, Caps Lock, and Num Lock LEDs on the
target computer system as listed in the chart below.
ASCII Response
Scroll Lock Status Caps Lock Status
Num Lock Status
“0”
Off
Off
Off
“1”
Off
Off
On
“2”
Off
On
Off
“3’
Off
On
On
“4”
On
Off
Off
“5”
On
Off
On
“6”
On
On
Off
“7”
On
On
On
11
[W2] - The most significant bit of the scroll wheel movement
magnitude.
[W1] - Bit 1 of the three bit value for scroll wheel movement.
[W0] - Least significant bit of the scroll wheel movement value.
[1] - Bit 3 of the #6 byte is always “1”. Sending “0” for this bit will
cause the entire mouse control packet to be ignored.
[MM] - State of the middle mouse button. Set to 1 for middle
mouse button on, 0 for the button to be off.
[MR] - State of the right mouse button. Set to 1 for right mouse
button on, 0 for the button to be off.
[ML] - State of the left mouse button. Set to 1 for left mouse
button on, 0 for the button to be off.
NOTES - When sending this six byte mouse command packet to
the USBtoUSB Com Port, the five bytes following the first 0x00
byte should be sent with no more than 50msec between each
byte. The starting value 0x00 must always be followed by five
additional bytes to complete the mouse control packet and avoid
any confusion between mouse control and keystroke commands.
The scroll wheel magnitude command is a 4 bit signed value
located in bits Ws through W0, and in the range of 0x00 to 0x07
for up movement, 0x0F to 0x08 for down movement.
The three mouse button bits [MM], [MR], and [ML] command the
states of the mouse buttons as seen by the target computer. A “1”
in the respective bit indicates the mouse button is on, while a “0”
indicates the button is off. Be sure to command the release of any
mouse buttons that were in the on state at a later time once the
mouse button task has completed.