64
"C" Programming Guide For Optimus S/R
The
SendData()
routine can not only transmit simple characters as above, but also provide a
way to transmit combination key status, or even direct scan codes. This is done by inserting
some special command codes in the output string. A command code is a character whose
value is between 0xC0 and 0xFF.
0xC0 : Indicates that the next character is to be treated as scan code. Transmit it as it is, no
translation required.
0xC0 | 0x01 : Send next character with Shift key.
0xC0 | 0x02 : Send next character with left Ctrl key.
0xC0 | 0x04 : Send next character with left Alt key.
0xC0 | 0x08 : Send next character with right Ctrl key.
0xC0 | 0x10 : Send next character with right Alt key.
0xC0 | 0x20 : Clear all combination status key after sending the next character.
For example, to send [A] [Ctrl-Insert] [5] [scan code 0x29] [Tab] [2] [Shift-Ctrl-A] [B]
[Alt-1] [Alt-2-Break] [Alt-1] [Alt-3], the following characters are inserted into the string
supplied to the
SendData()
routine.
0x41, 0xC2, 0x01, 0x35, 0xC0, 0x29, 0x09, 0x32, 0xC3, 0x41, 0x42, 0xC4, 0x31
0xE4, 0x32, 0xC4, 0x31, 0xC4, 0x33
Please note that, the scan code 0x29 is actually a space for PCAT, Alt-12 is a form feed
character, and Alt-13 is an Enter. The break after Alt-12 is necessary, if omitted the
characters will be treated as Alt-1213 instead of Alt-12 and Alt-13.
SendData
Purpose
To send a string to the host via keyboard wedge interface.
Syntax
void SendData (char *out_str);
Example
SendData (CodeBuf);
Description
This routine transmits a string pointed by
out_str
to the keyboard wedge
interface.
Return
None
See Also
WedgeReady
WedgeReady
Purpose
To check if the keyboard wedge is ready to send data.
Summary of Contents for Optimus R
Page 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Page 6: ......
Page 8: ...2 C Programming Guide For Optimus S R...
Page 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Page 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Page 24: ...18 C Programming Guide For Optimus S R...
Page 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...