Discussion in "Project Help" started by    majoka    Apr 28, 2015.
Tue Apr 28 2015, 09:37 am
#1
Hello All Members ,
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

Wed Apr 29 2015, 03:02 am
#2
Hi Naseem.. of course we miss you



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 ]
Wed Apr 29 2015, 09:22 am
#3
thank you ExperimenterUK
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
Wed Apr 29 2015, 11:02 am
#4
I think you will have to remove keys such as Shift and Ctrl from the matrix and monitor
them separately.

Wed Apr 29 2015, 11:37 pm
#5
Well usually when we write key scanning code we scan one key and then we exit out. instead make an array and run through loop to get at least 2 keys when scanning. write your get_key function in such a way that return code is number of keys detected and a buffer to be passed which stores the key code.
// 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...
Thu Apr 30 2015, 01:32 am
#6


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 ]

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Davidbab
Tue Apr 23 2024, 10:41 am
Richardrit
Tue Apr 23 2024, 09:54 am
HenryLaf
Mon Apr 22 2024, 03:50 pm
bleradrar
Mon Apr 22 2024, 06:38 am
ppu-pro_ka
Sun Apr 21 2024, 07:39 pm
Infewow
Sun Apr 21 2024, 06:30 pm
HumanTak
Sun Apr 21 2024, 12:26 pm
Zacharybus
Sun Apr 21 2024, 02:45 am