[futurebasic] Re: a useful function...

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1997 : Group Archive : Group : All Groups

From: Mel Patrick <mel@...>
Date: Fri, 28 Nov 1997 17:08:26 -0800
[get keys snip]

and further to that, heres how to look for those function key along the top
of the keyboard :

LOCAL FN TestFNKeys:'                              do a test for function keys
  DIM KeyRecord(7):'                         Record structure for keyboard map
  CALL GETKEYS(KeyRecord(0)):'      this reads the keyboard map into the array
  whichKey=_False:'                         set for no key match to start with
  keyPos=6:'                             start search with this array position
  DO
    SELECT keyPos:'                           see which key we are looking for
      CASE 6:'                                                    array row 6?
        SELECT KeyRecord(keyPos):'                and see which position is on
          CASE 2:'                                                         F13
            whichKey=13
          CASE 8:'                                                         F14
            whichKey=14
          CASE 32:'                                                        F10
            whichKey=10
          CASE 128:'                                                       F12
            whichKey=12
          CASE 256:'                                                        F5
            whichKey=5
          CASE 512:'                                                        F6
            whichKey=6
          CASE 1024:'                                                       F7
            whichKey=7
          CASE 2048:'                                                       F3
            whichKey=3
          CASE 4096:'                                                       F8
            whichKey=8
          CASE 8192:'                                                       F9
            whichKey=9
          CASE -32768:'                                                    F11
            whichKey=11
        END SELECT
      CASE 7:'                                               else array row 7?
        SELECT KeyRecord(keyPos):'                and see which position is on
          CASE 1:'                                                          F2
            whichKey=2
          CASE 4:'                                                          F1
            whichKey=1
          CASE 512:'                                                       F15
            whichKey=15
          CASE 16384:'                                                      F4
            whichKey=4
        END SELECT
    END SELECT
    INC(keyPos):'               add one to the key position in array to search
  UNTIL whichKey OR keyPos>7:'                       set limits to bail out at
END FN=whichKey
'

Mel Patrick - theWabbitGuy - mel@...
http://www.intergate.bc.ca/business/mel