File: i_key.cpp

package info (click to toggle)
fte 0.50.2b6-20110708-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,768 kB
  • sloc: cpp: 47,985; ansic: 2,795; sh: 112; makefile: 71; perl: 29
file content (40 lines) | stat: -rw-r--r-- 752 bytes parent folder | download | duplicates (6)
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
/*    i_key.cpp
 *
 *    Copyright (c) 1994-1996, Marko Macek
 *
 *    You may distribute under the terms of either the GNU General Public
 *    License or the Artistic License, as specified in the README file.
 *
 */

#include "i_key.h"
#include "sysdep.h"

ExKey::ExKey(const char *APrompt) :
    Prompt(APrompt)
{
}

ExKey::~ExKey() {
}

void ExKey::HandleEvent(TEvent &Event) {
    switch (Event.What) {
    case evKeyDown:
        Key = Event.Key.Code;
        if (!(Key & kfModifier)) // not ctrl,alt,shift, ....
            EndExec(1);
        Event.What = evNone;
        break;
    }
}

void ExKey::RepaintStatus() {
    TDrawBuffer B;
    int W, H;

    ConQuerySize(&W, &H);

    MoveCh(B, ' ', 0x17, W);
    ConPutBox(0, H - 1, W, 1, B);
}