CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Simulate a Keyboard and Send Character to PC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
cfernandez



Joined: 18 Oct 2003
Posts: 145

View user's profile Send private message

Simulate a Keyboard and Send Character to PC
PostPosted: Fri Oct 01, 2004 10:11 pm     Reply with quote

Hi,

I need to send character to PS2 PC, simulating a Keyboard. I have a card reader and want to send some byte to PC by PS2 Keyboard. My project is the same that a Bar Code Reader that send the data by keyboard to PC. Exist any person that can help me or have this routine.

Thank you very much!!

Best Regards,
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Oct 02, 2004 5:49 am     Reply with quote

Hi Carlos,

Following you will find the full set of PS2 scancodes. All you need is to reproduce and transmit
the corresponding code accordingly with it�s function. Take in mind that it is mandatory to generate
and transmit a code when a key is pressed and another code when the key was released.

Code:


US 104-key keyboard,  scancodes for PS2


"Make" code is generated when key is pressed.
"Break" code is generated when key is released.
Hex value of make code for each key is shown.

All keys:
   one-byte make code    = nn
   one-byte repeat code  = nn
   two-byte break code   = F0nn



 ____    ___________________    ___________________    ___________________
|    |  |    |    |    |    |  |    |    |    |    |  |    |    |    |    |
|Esc |  |F1  |F2  |F3  |F4  |  |F5  |F6  |F7  |F8  |  |F9  |F10 |F11 |F12 |
|    |  |    |    |    |    |  |    |    |    |    |  |    |    |    |    |
|  08|  |  07|  0F|  17|  1F|  |  27|  2F|  37|  3F|  |  47|  4F|  56|  5E|
|____|  |____|____|____|____|  |____|____|____|____|  |____|____|____|____|

 __________________________________________________________________________
|    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |
|~   |!   |@   |#   |$   |%   |^   |&   |*   |(   |)   |_   |+   ||   |bksp|
|`   |1   |2   |3   |4   |5   |6   |7   |8   |9   |0   |-   |=   |\   |    |
|  0E|  16|  1E|  26|  25|  2E|  36|  3D|  3E|  46|  45|  4E|  55|  5C|  66|
|____|____|____|____|____|____|____|____|____|____|____|____|____|____|____|
|    |    |    |    |    |    |    |    |    |    |    |    |    |         |
|Tab |Q   |W   |E   |R   |T   |Y   |U   |I   |O   |P   |{   |}   |         |
|    |    |    |    |    |    |    |    |    |    |    |[   |]   |         |
|  0D|  15|  1D|  24|  2D|  2C|  35|  3C|  43|  44|  4D|  54|  5B|         |
|____|____|____|____|____|____|____|____|____|____|____|____|____|         |
|    |    |    |    |    |    |    |    |    |    |    |    |              |
|Caps|A   |S   |D   |F   |G   |H   |J   |K   |L   |:   |"   |     Enter    |
|    |    |    |    |    |    |    |    |    |    |;   |'   |              |
|  14|  1C|  1B|  23|  2B|  34|  33|  3B|  42|  4B|  4C|  52|            5A|
|____|____|____|____|____|____|____|____|____|____|____|____|______________|
|         |    |    |    |    |    |    |    |    |    |    |              |
| L Shift |Z   |X   |C   |V   |B   |N   |M   |<   |>   |?   |   R Shift    |
|         |    |    |    |    |    |    |    |,   |.   |/   |              |
|       12|  1A|  22|  21|  2A|  32|  31|  3A|  41|  49|  4A|            59|
|_________|____|____|____|____|____|____|____|____|____|____|______________|
|       |       |       |                  |       |       |       |       |
|L Ctrl | L win | L Alt |       space      | R Alt | R win | menu  |R Ctrl |
|       |       |       |                  |       |       |       |       |
|     11|     8B|     19|                29|     39|     8C|     8D|     58|
|_______|_______|_______|__________________|_______|_______|_______|_______|




 ____ ____ ____
|    |    |    |
|Prt |Scrl|Paus|
|Scrn|Lock|Brk |
|  57|  5F|  62|
|____|____|____|

 ____ ____ ____   ____ ____ ____ ____
|    |    |    | |    |    |    |    |
|Ins |Home|PgUp| |Num |/   |*   |-   |
|    |    |    | |Lock|    |    |    |
|  67|  6E|  6F| |  76|  77|  7E|  84|
|____|____|____| |____|____|____|____|
|    |    |    | |    |    |    |    |
|Del |End |PgDn| |7   |8   |9   |    |
|    |    |    | |Home|(U) |PgUp|    |
|  64|  65|  6D| |  6C|  75|  7D|    |
|____|____|____| |____|____|____|    |
                 |    |    |    |+   |
                 |4   |5   |6   |    |
       |(L) |    |(R) |    |
                 |  6B|  73|  74|  7C|
      ____       |____|____|____|____|
     |    |      |    |    |    |    |
     |(U) |      |1   |2   |3   |    |
     |    |      |End |(D) |PgDn|    |
     |  63|      |  69|  72|  7A|Ent |
 ____|____|____  |____|____|____|    |
|    |    |    | |         |    |    |
|(L) |(D) |(R) | |0        |.   |    |
|    |    |    | |Ins      |Del |    |
|  61|  60|  6A| |       70|  71|  79|
|____|____|____| |_________|____|____|


code key        code key        code key        code key
---- ---        ---- ---        ---- ---        ---- ---
07   F1         2A   V          4A   /?         6B   (left) 4
08   Esc        2B   F          4B   L          6C   Home 7
                2C   T          4C   ;:         6D   PageDown
0D   Tab        2D   R          4D   P          6E   Home
0E   `~         2E   5%         4E   -_         6F   PageUp
0F   F2         2F   F6         4F   F10        70   Ins 0
                                                71   Del .
11   L Ctrl     31   N          52   '"         72   (down) 2
12   L Shift    32   B                          73   5
                33   H          54   [{         74   (right) 6
14   CapsLock   34   G          55   =+         75   (up) 8
15   Q          35   Y          56   F11        76   NumLock
16   1!         36   6^         57   PrintScr   77   /
17   F3         37   F7         58   R Ctrl
                                59   R Shift    79   Enter (on numeric keypad)
19   L Alt      39   R Alt      5A   Enter      7A   PageDown 3
1A   Z          3A   M          5B   ]}
1B   S          3B   J          5C   \|         7C   +
1C   A          3C   U                          7D   PageUp 9
1D   W          3D   7&         5E   F12        7E   *
1E   2@         3E   8*         5F   ScrollLock
1F   F4         3F   F8         60   (down)     84   -
                                61   (left)
21   C          41   ,<         62   Pause      8B   L Win
22   X          42   K          63   (up)       8C   R Win
23   D          43   I          64   Del        8D   Menu
24   E          44   O          65   End
25   4$         45   0)         66   BackSpace
26   3#         46   9(         67   Ins
27   F5         47   F9
                                69   End 1
29   Space      49   .>         6A   (right)




Best wishes,

Humberto
cfernandez



Joined: 18 Oct 2003
Posts: 145

View user's profile Send private message

PostPosted: Sat Oct 02, 2004 9:39 am     Reply with quote

Humberto,

Vos tenes alguna rutina en C para poder conectar un PIC al puerto PS2 PC y enviar caracteres como si fuera el teclado?. Es mas este PIC debe estar entre el teclado y la PC, imaginate un lector de codigo de barras o banda magnetica que se conecta asi y le mandan los caracteres a la PC que obtienen de su lectura.

Espero que puedas ayudarme, muchas gracias.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Oct 02, 2004 11:19 am     Reply with quote

Arrow

I will contact you in your private mssge box,

Regards

Humberto
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sat Oct 02, 2004 11:44 am     Reply with quote

Quote:

Humberto,

Vos tenes alguna rutina en C para poder conectar un PIC al puerto PS2 PC y enviar caracteres como si fuera el teclado?. Es mas este PIC debe estar entre el teclado y la PC, imaginate un lector de codigo de barras o banda magnetica que se conecta asi y le mandan los caracteres a la PC que obtienen de su lectura.

Espero que puedas ayudarme, muchas gracias.


Roughly translated:

Do you have some routines in C to be able to connect a PIC to a PC's PS2 port and send characters as though it was a keyboard? This PIC should go between the keyboard and the PC. Imagine a bar code or magnetic stripe reader that will send the characters to the PC from the data that it obtains from its reading.

I expect that you can help me, many thanks.


Check this link out:
http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/PS2/ps2.htm
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Oct 02, 2004 12:17 pm     Reply with quote

Mark,

You are very kindly for translate this thread. As you can guess, Spanish is my natural language
but I make the effort to try to communicate in English because I don't want to betray the spirit of
this board which is to share our knowledge and experiences in a common language.
Anyway I just send a private message to cfernandez regarding the thread.

Thanks again and people like you are the responsible that made of this board one of the
most genuine discussion of embedded C systems.

Humberto Very Happy
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sat Oct 02, 2004 2:12 pm     Reply with quote

I understand the reason that some post in their native language. However, they will get the most responses if they post it in the language that most of the posters understand. Very Happy Thanks for the praise.
jelodavid



Joined: 03 Apr 2005
Posts: 22
Location: Laguna Philippines

View user's profile Send private message Yahoo Messenger

PostPosted: Tue May 19, 2009 6:15 pm     Reply with quote

Hello everybody,
I also need this code for my project. But i'm a bit confused about sending characters from PIC to PC. Maybe a sample code from you guys will help me a lot..pls
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group