The MASM Forum

General => The Campus => Topic started by: xandaz on September 09, 2012, 11:10:30 AM

Title: Setting keyboard typematic rate and delay...
Post by: xandaz on September 09, 2012, 11:10:30 AM
   i have this code but doesnt change anything in the keyboard. f3 command is supposed to set typematic rate and delay but does nothing. Tried ports 60h and 64h.
Code: [Select]
.586p
.model flat,stdcall
option casemap:none

include \masm32\kmdkit\include\w2k\ntstatus.inc
include \masm32\kmdkit\include\w2k\ntddk.inc
include \masm32\kmdkit\include\w2k\ntoskrnl.inc

includelib \masm32\kmdkit\lib\w2k\ntoskrnl.lib

wdkinc  MACRO   incx
include \masm32\kmdkit\include\w2k\incx.inc
ENDM
wdklib  MACRO   libx
includelib \masm32\kmdkit\lib\w2k\libx.lib
ENDM
.data
wdkinc  ntddk
MyString    db  'Hello!',0

.code

DriverEntry PROC    pDriverObject:DWORD,pRegistryPath:DWORD

    mov     al,0f4h
    out     60h,al
    mov     al,0f3h
    out     60h,al
    xor     al,al
    out     60h,al
    mov     eax,STATUS_SUCCESS
    ret
.....
Thanks
Title: Re: Setting keyboard typematic rate and delay...
Post by: qWord on September 09, 2012, 11:24:49 AM
You maybe forgot that there allready a keyboard driver running?
Title: Re: Setting keyboard typematic rate and delay...
Post by: japheth on September 09, 2012, 02:41:54 PM
Tried ports 60h and 64h.

Port 64h can't be correct, because sending F4h to port 64h usually resets the cpu.

If you want to send something to the keyboard thru port 60h, you first have to check that the keyboard is ready to receive data - IIRC it's bit 1 (or 0?) at port 64h that has to become 0 before you can send something to port 60h.