git-svn-id: https://spexeah.com:8443/svn/Asuro@104 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c

This commit is contained in:
aaron 2017-05-18 14:46:56 +00:00
parent c595bfb819
commit 47cf4ff789

View File

@ -30,22 +30,19 @@ var
key_buffer : array[1..128] of TkeyInfo;
procedure init(keyboard_layout : pchar);
procedure init(keyboard_layout : array of TKeyInfo);
procedure callback(scan_code : void);
procedure buffer_push_sc(scan_code : uInt8);
procedure lang_UK();
procedure lang_USA();
implementation
procedure init(keyboard_layout : pchar);
procedure init(keyboard_layout : array of TKeyInfo);
begin
memset(uint32(@key_matrix[0]), 0, sizeof(TKeyInfo)*256);
memset(uint32(@key_buffer), 0, sizeof(TKeyInfo)*128);
if(keyboard_layout = pchar('USA')) then lang_USA();
if(keyboard_layout = pchar('UK')) then lang_UK();
if keyboard_layout[1].key_code = 0 then lang_USA();
isr33.hook(uint32(@callback));
@ -56,6 +53,7 @@ begin
if key_matrix[uint8(scan_code)].key_code <> 0 then begin
buffer_push_sc(uint8(scan_code));
console.writechar(char(key_buffer[0].key_code));
console.writehexln(uint8(scan_code));
end;
end;
@ -71,11 +69,6 @@ begin
end;
procedure lang_UK();
begin
end;
procedure lang_USA();
begin
key_matrix[1].key_code := $1B;