On Sat, 10 Jun 2000, BFL5-CDC wrote:
> Hi all,
> I am facing a strange problem with the read system call. If I type keys one
> at a time (what ever be the speed) the read system call reads make and
> break codes in the correct order. If I type many keys simultaneously, the
> exact sequence of make and break codes are not read! For example if I just
> slide my finger on a row of keys of a keyboard swiftly, the make and break
> codes are not read properly. 
> 
> 
> Here is an example: 
> If I slide my finger on keys ~123456789 I should see the make and break
> code sequence as : 0x20 0xa9 0x02 0x82 0x03 0x83 0x04 0x84 etc.
> Instead I am seeing : 0x29 0x02 0xa9 0x03 0x82 0x04 0x83 0x05 ..etc
> 
> I have checked my code. There is no problem in that. Since a read call
> blocks the process till the key is released, I should always get correct
> sequence. Could any one help me how to resolve this issue? Your help will
> be deeply appreciated!
> 
> I am using red hat linux 6.1 kernel 2.2.12. I have set the keyboard in RAW
> mode before using read call.

It is supposed to do that.
The keyboard hardware reports all events, in the order that they occur.
Each "make" of a key is an event, and each "break" of a key is an event.

So if you press key "a", then press key "b", then release key "a", the
release key "b"; you should see the codes come out in that order.

For instance, in the example you gave the "~" key was still pressed, when
your keyboard detected that the "1" key was pressed.

-- 

David L. Martin        <[EMAIL PROTECTED]>
R&D Software Engineer
PGP: 16 C0 C0 AB 4E A2 2C 89  FF 8B 07 CF C0 72 3D 89

Nurses frequently awaken patients to give them a sleeping pill. 
 


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to