From: Colin w Glenn Newsgroups: comp.os.msdos.djgpp Subject: Re: Interesting Allegro Keyboard Phenomenon... Date: Sun, 1 Nov 1998 20:06:02 -0600 Organization: Greater New Orleans Free-Net Lines: 60 Message-ID: References: <71i313$o8b AT nnrp2 DOT farm DOT idt DOT net> NNTP-Posting-Host: sparkie.gnofn.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <71i313$o8b@nnrp2.farm.idt.net> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Errr, like the SHIFT flag isn't being reset by the program when it exits, it a BIOS thing, one of those memory locations down under in the low memory zone. You MIGHT have to do a little cleaning up and ensure the CAPS-LOCK flag bit is equal to the state of the CAPS-LOCK led. On Sun, 1 Nov 1998, Chia wrote: ->Speculation is welcome. =) -> ->This pertains to a C++ GUI that I've been developing using Allegro. ->Recently, simple text-fields have been added. -> ->The interesting phenomenon is as follows: -> -> If you run a program with a textfield in it, and you don't type anything ->in the textfield, dos behaves as normal when the program exits. -> -> If you run a program with a textfield in it, and you type all lower-case ->stuff in the textfield, when you exit the program dos behaves as normal. -> -> If you run a program with a textfield in it, and you type any capital ->letters, when you exist dos will have a type of caps-lock enabled. This ->caps-lock doesn't light the caps-lock light on the keyboard, but it behaves ->just as a caps lock does. If you type a character w/o shifting, it's in ->uppercase, and if you type it with shifting, it's in lowercase. Putting the ->real caps-lock on has the effect of making everything normal again. -> -> This effect also ends if you press the left shift key once. -> ->While this is an interesting effect, I'm wondering how to make it stop. ->Does anyone have any clue what would cause something like this to happen? -> ->Some additional info about my program: -> -> The GUI is using the Allegro keyboard handlers, so I created a simple ->array to convert ascii letters to Allegro scancodes. -> -> I also put in a keyboard callback function that would check for the ->[ins] key being pressed so that I could have a global insert/overwrite mode ->flag. -> -> There are also three #define macros that are as follows: -> -> #define SHIFT (key_shifts & KB_SHIFT_FLAG) -> #define ALT (key_shifts & KB_ALT_FLAG) -> #define CTRL (key_shifts & KB_CTRL_FLAG) -> -> Which I'm just using to do things like this: -> -> if (SHIFT) { /* stuff */ } -> ->Thanks! -> ->// chia AT top DOT net -- http://www.top.net/chia/ -> -> -> ->