Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Keyboard num lock scan code problem.

Hi, Ive got a problem with implement the scan codes for the case which num lock is on. i would like to use keypad 1-9 number on the keyboard as numbers, not as arrows, pg dn, pg up, etc.. the scan codes shown in easy scan.bmp shown below, i can easily implement. for example using the following process below because the scan codes are 8 bits long as shown here (example) https://www.alteraforum.com/forum/attachment.php?attachmentid=2161

------------------------------------------------------------------

PROCESS (scan_code, ready_set)

BEGIN

IF (ready_set = '1') THEN

CASE scan_code IS

WHEN "00011100" => -- A

temp1 <="00011100";

data1 <= "1111001";

data0 <= "1000000";

WHEN "00110010" => -- B

temp1 <="00110010";

data1 <= "0100100";

data0 <= "1000000";

WHEN "00100001" => -- C

temp1 <="00100001";

data1 <= "0110000";

data0 <= "1000000";

WHEN "11110000" => -- break code

if temp1 ="00011100" then --A

data1 <= "1111001";

data0 <= "1000000";

ELSIF temp1 ="00110010" then --B

data1 <= "0100100";

data0 <= "1000000";

ELSIF temp1 ="00100001" then --C

data1 <= "0110000";

data0 <= "1000000";

ELSE

NULL;

END IF;

WHEN OTHERS => null;

END CASE;

END PROCESS;

--------------------------------------------------------------------

but the problem arises when i have to use the keypad numbers. the make and break codes for the keys are longer than 8 bits as shown here https://www.alteraforum.com/forum/attachment.php?attachmentid=2162

the reason why i want to use them as numbers, keypad 1(End), 2(Down), 3(Page Down), 4(Left), 6(Right), 7(Home), 8(Up), 9(Page Up) keys and keyboard's Home, Page up, Page down, End, Up, Down, Left & Right, share same scan codes when num lock is off. i really dont how to go about solving this problem (to write the process required). The complete keyboard code is attached. please help me out guys.

Regards

Dante
No RepliesBe the first to reply