delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/01/11:50:06

From: "Chia" <chia AT top DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Interesting Allegro Keyboard Phenomenon...
Date: Sun, 1 Nov 1998 10:45:40 -0600
Organization: 404 Software
Lines: 49
Message-ID: <71i313$o8b@nnrp2.farm.idt.net>
NNTP-Posting-Host: flex-7.top.net
X-Newsreader: Microsoft Outlook Express 4.72.2106.4
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019