From: ryan4600 AT my-deja DOT com Newsgroups: comp.os.msdos.djgpp Subject: Keyboard Handler problem Date: Tue, 06 Jun 2000 10:03:52 GMT Organization: Deja.com - Before you buy. Lines: 29 Message-ID: <8hiia1$lvs$1@nnrp1.deja.com> NNTP-Posting-Host: 24.64.21.150 X-Article-Creation-Date: Tue Jun 06 10:03:52 2000 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98) X-Http-Proxy: 1.1 x70.deja.com:80 (Squid/1.1.22) for client 24.64.21.150 X-MyDeja-Info: XMYDJUIDryan4600 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi, I am writing a keyboard handler and am having some problems with writing efficient code. I have successfully locked all code (using DPMI functions) and can get most of the keys on my keyboard. But these are the problems I am having. I have a state map which gets the state of keys like the alt and control key. Now the array I am using for this purpose is global in my program as I can't pass anything to the handler function. Similarly there are other variables being used in the handler which are global. Is it okay to pass variables to the handler(like other C functions)? Another problem is that my handler size is getting bigger as I am making many checks inside the handler. One of them is for checking if the buffer (I am using) is full or not. Then there are othes for checking if any of the function keys was pressed, or any other keys I want to ignore. Is it okay to make checks in the ISR? Or should I make them outside? Thanks, Ryan Sent via Deja.com http://www.deja.com/ Before you buy.