Making a custom PS2-Keyboard
after a long time I am here I hope all miss me
I am trying to make a custom ps2 keyboard using AT89C52
I have 7 rows and 15 columns having all numeric keys and Alphabets with some special keys like Ctrl , Alt , Insert and shift
each rows have 15 or less than 15 keys
I make a look up table according to keys layout and scan it like an ordinary keypad and get success i also generate a ps2 protocol and send Scan code to PC and all numeric and alphabets keys are working in notepad typing
the point where I need a logic (help) is that i want to do behave like a ps2 keyboard when two keys are pressed simultaneously like Ctrl+A to select all
i need a help in general logarithm to implement a standard ps2 keyboard (not all features)
Regards
Naseem Majoka
This website seems to be cover the details very well
Example: What sequence of make codes and break codes should be sent to your computer for the character "G" to appear in a word processor? Since this is an upper-case letter, the sequence of events that need to take place are: press the "Shift" key, press the "G" key, release the "G" key, release the "Shift" key. The scan codes associated with these events are the following: make code for the "Shift" key (12h), make code for the "G" key (34h), break code for the "G" key(F0h,34h), break code for the "Shift" key (F0h,12h). Therefore, the data sent to your computer would be: 12h, 34h, F0h, 34h, F0h, 12h.computer-engineering Article
It seems you don't need any fancy algorithm.
Just send a report of a key being pressed or released as it happens.
[ Edited Wed Apr 29 2015, 03:05 am ]
actually i read this break and make sequence and about scan codes as well
i am facing a problem in making a logic when two keys are simultaneously press then two columns are low as we do in simple keypad
now how we detect that a Ctrl and A key is pressed
them separately.
// Prototype int get_key(char *key_code); // usage keys = get_key(codes); //keys will have number of detected keys // codes is an array stores codes for those pressed keys
Now question here is.. how do you understand which is pressed first. So I think experimenterUK has a better solution... detect special keys separately...
Now question here is.. how do you understand which is pressed first. So I think experimenterUK has a better solution... detect special keys separately...ajay_bhargav
I think your way is better Ajay
I had it in mind that you could only detect one key at a time,
but if you can detect two at once, just scan as normal.
A fast scan should detect which key is pressed first.
If Ctrl and A do appear simultaneously , just send make Ctrl then make A
[ Edited Fri May 01 2015, 03:42 am ]