summaryrefslogtreecommitdiff
path: root/tvision/classes/alcon/alconmouse.cc
blob: a6e6143c9db2f0ac5987253fc0e523408e38238d (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
44
45
46
47
/*****************************************************************************

  Copyright (c) 2003-2004 by Grzegorz Adam Hankiewicz
  Copyright (c) 2004-2009 by Salvador E. Tropea (SET) <set@ieee.org>
  
  THWMouseAlcon
  AlCon driver for Turbo Vision. It uses the conio.h emulation library on top
  of Allegro.

  Contributed by Grzegorz Adam Hankiewicz <gradha@hankiewicz.datanet.co.uk>

  This is part of Turbo Vision ditribution and covered by the same license.

*****************************************************************************/

#include <tv/configtv.h>

#define Uses_stdio
#define Uses_TScreen
#define Uses_TEvent
#define Uses_TGKey
#include <tv.h>

#include <tv/alcon/mouse.h>
#define Uses_AlCon_conio
#include <tv/alcon/alcon.h>

#ifdef HAVE_ALLEGRO

void THWMouseAlcon::Init()
{
 THWMouse::GetEvent=GetEvent;
 buttonCount=AlCon_GetMouseButtons();
}

THWMouseAlcon::~THWMouseAlcon()
{
}

void THWMouseAlcon::GetEvent(MouseEventType &me)
{
 int buttons;
 AlCon_GetMousePos(&me.where.x, &me.where.y, &buttons);
 me.buttons = uchar(buttons & 255);
 me.doubleClick=False;
}
#endif // HAVE_ALLEGRO