•  Back 
  •  BIOS Function Reference 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-Fileevnt_keybd()
evnt_multi()
Cconin()
Bconin()
Kbshift()                                                              BIOS

Syntax

LONG Kbshift( mode )
WORD mode;

Function      Kbshift() allows the user to interrogate or modify the state
              of the keyboard 'special' keys.

Opcode        11 (0x0B)

Availability  All TOS versions.

Parameters    mode is -1 to read the state of the keys or a mask of the
              following values to change the current state:

              Name         Mask   Meaning

              K_RSHIFT     0x01   Right shift key depressed

              K_LSHIFT     0x02   Left shift key depressed

              K_CTRL       0x04   Control key depressed

              K_ALT        0x08   Alternate key depressed

              K_CAPSLOCK   0x10   Caps-lock engaged

              K_CLRHOME    0x20   Clr/Home key depressed

              K_INSERT     0x40   Insert key depressed

Binding       move.w   mode,-(sp)
              move.w   #$0B,-(sp)
              trap     #13
              addq.l   #4,sp

Return Value  Kbshift() returns the state that the keyboard 'special' keys
              were in prior to the call.

Comments      Kbshift() is not a particularly fast call. If you are only
              interested in reading the state a documented macro follows
              that replaces Kbshift() and is much faster. Call the
              kb_init() function, as shown below, before using:

              char *p_kbshift;
              #define Kbstate()   *p_kbshift

              VOID
              kb_init(VOID)
              {
               /* GetROMSysbase is defined in the BIOS Overview */
               OSHEADER *osheader = GetROMSysbase();

               if ( osheader->os_version == 0x0100 )
                 p_kbshift = (char *)0xe1bL;
               else
                 p_kbshift = *(char **)osheader->p_kbshift;
              }

See Also      evnt_keybd(), evnt_multi(), Cconin(), Bconin()