Hi!
I need your help with the keyboard access using the ports.
When I write 00000010b to port 0x13h
and read the byte value afterwards it is always
01000000b no matter if I pressed 0 or A but it should only
respond to the 0 key. Can you help me and tell me how to fix this?
I know some of you use the same methods (X-Thunder?!) Please tell me how you work with it!
Cya huhn
Keyboard usage in asm/c?
Started by
huhn_m
, Aug 22 2003 05:56 AM
3 replies to this topic
#1
Posted 22 August 2003 - 05:56 AM
#2
Posted 23 August 2003 - 07:49 PM
I'm not sure, but I use Touche by 2072 and there is very useful key recognizer. It is, as you say, the same value if you press 0, A, or G etc. This is 00000010b - about column. But there is also still one more information about rows - and 0, EXP, EXE are the same, because the are in the same row.
When you tried to write 00000010b value, you wrote it to 'row' information, I supose.
So if you want to identify the pressed key, you must check these two P-13h states with x and y coordinates.
I can't say how you should read these values, I'm not a good asm programmer, I only use the rows and column information from P-13h i my C progs.
When you tried to write 00000010b value, you wrote it to 'row' information, I supose.
So if you want to identify the pressed key, you must check these two P-13h states with x and y coordinates.
I can't say how you should read these values, I'm not a good asm programmer, I only use the rows and column information from P-13h i my C progs.
#3
Posted 24 August 2003 - 09:56 AM
I know how to do it in theory:
You write 1 SHL (number of col) as a word to port 13h
and then you read it and the bytes that are turned on are the keys pressed.
But it doesn't matter what I write to the port!
It always returns the same. If I select the line with 0->EXE
and press the 4 key
the response(value read from port) is 01000000 though but it shouldn't since no key in the lin 0->EXE
was pressed!
You write 1 SHL (number of col) as a word to port 13h
and then you read it and the bytes that are turned on are the keys pressed.
But it doesn't matter what I write to the port!
It always returns the same. If I select the line with 0->EXE
and press the 4 key
the response(value read from port) is 01000000 though but it shouldn't since no key in the lin 0->EXE
was pressed!
#4
Posted 24 August 2003 - 05:52 PM
Well maybe you read too fast... I remember this problem happened to someone else...
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users