summaryrefslogtreecommitdiffstats
path: root/libksirtet/lib/keys.h
blob: 16e25118c165db06b2f2025ec0338f9db9104cf1 (plain)
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
43
#ifndef KEYS_H
#define KEYS_H

#include <tqmap.h>
#include <kaction.h>

#include "mp_interface.h"


class KeyData : public TQObject
{
 Q_OBJECT
  TQ_OBJECT
 public:
    KeyData(uint maxNb, uint nbActions, const ActionData *,
            TQObject *tqparent);
    void setKeycodes(uint nb, uint i, const int *keycodes);

    void setCurrentNb(uint nb);
    void clear();
    void createActionCollection(uint index, TQWidget *receiver);
    void setEnabled(uint index, bool enabled);
    void addKeys(KKeyDialog &);
    void save();

    void keyEvent(TQKeyEvent *e, bool pressed);

 private:
    uint                                   _maxNb;
    TQMemArray<ActionData>                  _data;
    TQMap<int, TQMap<int, TQMemArray<int> > > _keycodes;
    TQMemArray<KActionCollection *>         _cols;
    struct SpecialData {
        bool enabled;
        TQSignal *pressed, *released;
    };
    TQMap<KAction *, SpecialData>           _specActions;

    TQString group() const
        { return TQString("Keys (%1 humans)").tqarg(_cols.size()); }
};

#endif // KEYS_H