~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to docs/kbdex/ex5.pp

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
program example5;
2
 
 
3
 
{ This program demonstrates the PutKeyEvent function }
4
 
 
5
 
uses keyboard;
6
 
 
7
 
Var
8
 
  K,k2 : TKeyEvent;
9
 
 
10
 
begin
11
 
  InitKeyBoard;
12
 
  Writeln('Press keys, press "q" to end.');
13
 
  K2:=0;
14
 
  Repeat
15
 
    K:=GetKeyEvent;
16
 
    If k<>0 then
17
 
      begin
18
 
      if (k2 mod 2)=0 then
19
 
        K2:=K+1
20
 
      else
21
 
        K2:=0;
22
 
      K:=TranslateKeyEvent(K);
23
 
      Writeln('Got key : ',KeyEventToString(K));
24
 
      if (K2<>0) then
25
 
        begin
26
 
        PutKeyEvent(k2);
27
 
        K2:=TranslateKeyEVent(K2);
28
 
        Writeln('Put key : ',KeyEventToString(K2))
29
 
        end
30
 
      end
31
 
  Until (GetKeyEventChar(K)='q');
32
 
  DoneKeyBoard;
33
 
end.