home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / clib / progs / timslib / TimsLib / c / Kbd < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.4 KB  |  55 lines

  1. /* Kbd.c */
  2. /*                           
  3.  
  4.   #####                 #         #
  5.     #    #              #      #  #
  6.     #                   #         #
  7.     #   ##  ####   #### #     ##  ####
  8.     #    #  # # # #     #      #  #   #
  9.     #    #  # # #  ###  #      #  #   #
  10.     #    #  # # #     # #      #  #   #
  11.     #   ### # # # ####  ##### ### ####
  12.  
  13. -----------------------------------------------------------------------------
  14.  
  15. This is source for use with the 'DeskLib' Wimp C programming library for
  16. Risc OS. I currently use v1.04 of DeskLib.  This source is FreeWare, which
  17. means you can use it to write commercial applications, but you may not charge
  18. *in any way* for the distribution of this source.  I (Tim Browse) retain
  19. all copyright on this source.
  20.  
  21. This source is provided 'as is' and I offer no guarantees that is useful,
  22. bug-free, commented, that it will compile, or even that it exists.
  23.  
  24. If it breaks in half, you own both pieces.
  25.  
  26. All source © Tim Browse 1993
  27.  
  28. -----------------------------------------------------------------------------
  29.  
  30. */
  31.  
  32. /* RISCOS_Lib includes */
  33. #include "os.h"
  34. #include "swis.h"
  35.  
  36. /* Glazier includes */
  37. #include "stdhdr.h"
  38.  
  39. #include "Kbd.h"
  40.  
  41.  
  42. BOOL Kbd_PollAlt(void)
  43. {
  44.   os_regset regs;
  45.  
  46.   regs.r[0] = 129;      /* Read kbd for info - see PRM p498                    */
  47.   regs.r[1] = 2 ^ 0xFF; /* 5 is the internal key code of the left hand ALT key */
  48.   regs.r[2] = 0xFF;
  49.  
  50.   os_swix(OS_Byte, ®s);
  51.  
  52.   return (regs.r[1] == 0xFF);
  53. }
  54.  
  55.