Is there a Reference for I/O address's. I found a few sites but they didnt help much.
I.E http://www.pcguide.com/ref/mbsys/res/ioSummary-c.html

The Address im looking for is of the keyboard, and it says like 60-6FH?


Thanks
Posted on 2003-12-15 00:06:46 by WhiteDwarf

Is there a Reference for I/O address's. I found a few sites but they didnt help much.
I.E http://www.pcguide.com/ref/mbsys/res/ioSummary-c.html

The Address im looking for is of the keyboard, and it says like 60-6FH?


Thanks


Such guides certainly exist (e.g., this information is described in the 16-bit edition of AoA), but keep in mind that under Windows or Linux (i.e., when using HLA) you cannot normally access I/O ports unless you're writing a priviledged program (i.e., a device driver).
Cheers,
Randy Hyde
Posted on 2003-12-15 16:54:32 by rhyde
Hmm lol well i wasn't tryin to write a device driver or anything :-P. Lol i just wanted to write a keylogger :-/, i also plan on using that method to replace a stdin.getc() function in a game im making, having to hit enter really slows things down. So is there a better method of getting input?

Thanks
Posted on 2003-12-15 18:41:00 by WhiteDwarf
keylogger, ick.
Anyway, direct port-banging isn't good under windows - which I assume you're using?
There's better methods, depending on what you need. DirectInput, keyboard hooking, or processing WM_KEYDOWN+WM_KEYUP or WM_CHAR in your wndproc.
Posted on 2003-12-15 18:48:01 by f0dder
lol that was way over my head.:) But i get the general idea that i was moving in the wrong direction. Could you explain those a lil bit perhaps?:)


Thankya , Andy
Posted on 2003-12-15 19:28:37 by WhiteDwarf
Hm, I'm not sure whether to help you since you mentioned keylogging, but you mentioned games too, and the code is generic...

Setting a windows hook for keyboard input would be done with SetWindowsHookEx, with the WH_KEYBOARD hook type. I've seen a couple games do this. I haven't messed with DirectInput, so you'd have to ask someone else about this; there's been some questions on the board before I believe.

If your needs are simple (hell, this probably even works for some games), and you're using a normal message pump, you could handle WM_KEYUP and WM_KEYDOWN in your wndproc.

I'm sorry I don't have any sample code available, but MSDN/PlatformSDK should be your friend.
Posted on 2003-12-15 19:52:09 by f0dder

Hmm lol well i wasn't tryin to write a device driver or anything :-P. Lol i just wanted to write a keylogger :-/, i also plan on using that method to replace a stdin.getc() function in a game im making, having to hit enter really slows things down. So is there a better method of getting input?

Thanks


If you just want better input, try using the Win32 Console API functions to read the console input (i.e., "raw" or "uncooked" input).

If you really want to log input, you might take a look at Windows' "journalling" facilities.
Cheers,
Randy Hyde
Posted on 2003-12-16 10:59:18 by rhyde
Yea some examples of using the SetWindowsHookEx would be extremely helpful. I just need help understanding the parameters. All the Iczelions examples usually have to do with building a full on GUI...so i get very confused in the hundreds upon hundreds of lines of code....Thankyou
Posted on 2003-12-19 19:18:35 by WhiteDwarf
This is what i understand so far


SetWindowsHookEx(WH_KEYBOARD,lpfn,hmod, threadid);


That's all i can figure out.....I beleive the thread ID identifies the thread with which the hook procedure will use, so if im not mistaken that thread well handle the w.WM_CHAR. Then the lpfn is a pointer to the hook procedure.....dunno bout that....and hmod is a pointer to the DLL.....

So could you possibly help explain these with some code example perhaps....Thank you so much :)
Posted on 2003-12-19 22:29:29 by WhiteDwarf