File size: 680 Bytes
806d4b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42


<1>/* Graphics Not Rendered in HTML */




I64 x=0;

U0 DrawIt(CTask *,CDC *dc)
{
  Sprite3(dc,x%100,100,0,<1>);
}

U0 KeyDownBitMapDemo()
{
//This conversion routine is slow.
  I64 i_sc=Char2ScanCode('i');

  "Press and hold $GREEN$'i'$FG$.\n";
  while (!Bt(kbd.down_bitmap,i_sc))
    Yield;

  SettingsPush; //See SettingsPush
  Fs->draw_it=&DrawIt;

  //kbd.down_bitmap is indexed with the
  //merged scan code.  (left shift and
  //right shift combined for example.)
  //kbd.down_bitmap2 is indexed with the
  //distinct scan code.  See Char and Scan Codes.

  while (Bt(kbd.down_bitmap,i_sc)) {
    x++;
    Sleep(10);
  }
  SettingsPop;
  FlushMsgs;
}

KeyDownBitMapDemo;