background image

9

Key Number Mode Examples

Generation of keystrokes on the target computer is done through 
the  sending of special one byte codes in the Key Number Mode.

Each standard key of the PC keyboard is assigned a “make” code 
to emulate the press of a key, and a “break” code, which results in 
the release of the key.  The Key Number Table on the page 7
lists  each  of  the  supported  keys  and  their  corresponding  make 
and break codes.

From the keycode table, the value of 02 (0x02) can be sent to 
the unit to generate the “make” or press and hold of the “1” key.  
Sending a byte with a value of 130 (0x82) will result in the release 
of the “1” key.  

Important:

  For any key that has been previously sent a “make” 

code, a “break” code of that key must be sent at a later time.  
Failure to send the corresponding break code will leave the key in 
the down state on the target computer, which may result in unin-
tended keystrokes when new commands are sent.  The last key left 
in the make state without a break will repeat until the break code 
is sent.  Never command more than 60 keys in the “make” state 
at the same time as this will exceed the standard USB protocol 
keyboard buffer length for the USB-ASC232 device.

The use of make and break codes allows the user to create virtu-
ally any keystroke combination.  For example, if a sequence of 
CTRL+ALT+F1 was needed, the following codes would be sent,

58

 (L Ctrl make), 

60

 (L Alt make), 

112

 (Make F1), 

240

 (Break 

F1), 

188

 (Break L Alt), 

186

 (Break L Ctrl).

The example above assumes that the handshaking USB-ASC232 
is seen as not busy before sending the next command byte to the 
unit.

Producing Mouse Action on the Target PC

The  USB-ASC232  is  capable  of  controlling  the  mouse  cursor  and 
mouse button states through a special four byte command sequence.  
This command sequence can be used in any of the operating modes 
of the USB-ASC232.

The four byte mouse control sequence is construced as follows:

   Byte #1           Byte #2            Byte #3             Byte #4
[Command]    [X Movement]    [Y Movement]    [Scroll/Buttons]

Byte #1 - Always a 0x00 value, indicates start of packet.

Byte #2 - Signed byte for the magnitude of X direction movement.  
Values 0x01 to 0x7F move the cursor right, values 0xFF to 0x81 
move it left.  A 0x00 Value produces no X direction movement.

Byte #3 - Signed byte for the magnitude of Y direction movement.  
Values 0x01 to 0x7F move the cursor down, values 0xFF to 0x81 
move the cursor up. A 0x00 produces no Y movement.

Byte #4 - Byte for Scroll Wheel movement and mouse button
control.  The upper 4 bits of this byte contain a signed value for 
scroll wheel movement, while the lower 3 bits command the mouse 
Left, Right, and Middle button activation and deactivation.

This Byte #4 is constructed as shown,

     Bit 7    Bit 6    Bit 5    Bit 4    Bit 3    Bit 2    Bit 1   Bit 0
     [Ws]    [W2]    [W1]   [W0]     [1]     [MM]    [MR]   [ML]

[Ws] - The sign of the scroll wheel movement.  A zero in this bit 
commands  up  movement  on  the  scroll  wheel,  a  one  in  this  bit 
produces  down  scroll  wheel  movement.  Movement  magnitude 
based on the signed value in Ws through W0 values.

10

Содержание USB-ASC232

Страница 1: ...l Toll Free 888 690 9080 Phone 540 465 4677 Fax 540 465 4678 Monday through Friday 8 00 am to 5 00 pm EST sales hagstromelectronics com www hagstromelectronics com 1986 Junction Road Strasburg VA 2265...

Страница 2: ...the assembly testing and burn in of your USB ASC232 to ensure its performance If you have any questions please send us an email or give us a call Support is available Monday through Friday 8 00 am to...

Страница 3: ...onics com 17 2 CONTENTS Operating Voltage 5 Volts DC 5 Powered from USB port Operating Current Less than 100 ma Operating Temp 0 to 70 Degrees C PC Interface USB Target Computer RS 232 Serial Source C...

Страница 4: ...decimal 65 is received in this mode a capital A character will be produced as a keystroke on the computer at the USB end of the cable RS 232 characters received which are out of the 0x00 to 0x7f range...

Страница 5: ...to an extended ASCII character set character values 0x80 to 0xFF When an RS 232 byte is received in this mode it produces a USB keystroke on the PC which corresponds to the following table Parity may...

Страница 6: ...one none none none 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1...

Страница 7: ...if someone was physically holding that key on a keyboard Each time a make is sent for a key a corresponding break release of that key must be done at a later time to deactivate it The break code for a...

Страница 8: ...es shown above to produce the make and break actions for the corresponding key 12 When sending a mouse control packet for cursor movement only be sure to send all 0 values for the scroll wheel and mou...

Страница 9: ...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 b...

Страница 10: ...L Alt make 112 Make F1 240 Break F1 188 Break L Alt 186 Break L Ctrl The example above assumes that the handshaking USB ASC232 is seen as not busy before sending the next command byte to the unit Prod...

Страница 11: ...L Alt make 112 Make F1 240 Break F1 188 Break L Alt 186 Break L Ctrl The example above assumes that the handshaking USB ASC232 is seen as not busy before sending the next command byte to the unit Prod...

Страница 12: ...onse 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 scrol...

Страница 13: ...es shown above to produce the make and break actions for the corresponding key 12 When sending a mouse control packet for cursor movement only be sure to send all 0 values for the scroll wheel and mou...

Страница 14: ...if someone was physically holding that key on a keyboard Each time a make is sent for a key a corresponding break release of that key must be done at a later time to deactivate it The break code for a...

Страница 15: ...E 9F none none none none none 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD...

Страница 16: ...to an extended ASCII character set character values 0x80 to 0xFF When an RS 232 byte is received in this mode it produces a USB keystroke on the PC which corresponds to the following table Parity may...

Страница 17: ...decimal 65 is received in this mode a capital A character will be produced as a keystroke on the computer at the USB end of the cable RS 232 characters received which are out of the 0x00 to 0x7f range...

Страница 18: ...onics com 17 2 CONTENTS Operating Voltage 5 Volts DC 5 Powered from USB port Operating Current Less than 100 ma Operating Temp 0 to 70 Degrees C PC Interface USB Target Computer RS 232 Serial Source C...

Страница 19: ...the assembly testing and burn in of your USB ASC232 to ensure its performance If you have any questions please send us an email or give us a call Support is available Monday through Friday 8 00 am to...

Страница 20: ...l Toll Free 888 690 9080 Phone 540 465 4677 Fax 540 465 4678 Monday through Friday 8 00 am to 5 00 pm EST sales hagstromelectronics com www hagstromelectronics com 1986 Junction Road Strasburg VA 2265...

Отзывы: