~ubuntu-branches/ubuntu/trusty/heroes/trusty

« back to all changes in this revision

Viewing changes to src/media/keyb.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Burrows
  • Date: 2002-03-31 20:42:30 UTC
  • Revision ID: james.westby@ubuntu.com-20020331204230-v7i07q3km2dzu0et
Tags: upstream-0.21
ImportĀ upstreamĀ versionĀ 0.21

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*------------------------------------------------------------------.
 
2
| Copyright 1997, 1998, 2000, 2001  Alexandre Duret-Lutz            |
 
3
|                                    <duret_g@epita.fr>             |
 
4
|                                                                   |
 
5
| This file is part of Heroes.                                      |
 
6
|                                                                   |
 
7
| Heroes is free software; you can redistribute it and/or modify it |
 
8
| under the terms of the GNU General Public License version 2 as    |
 
9
| published by the Free Software Foundation.                        |
 
10
|                                                                   |
 
11
| Heroes is distributed in the hope that it will be useful, but     |
 
12
| WITHOUT ANY WARRANTY; without even the implied warranty of        |
 
13
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU |
 
14
| General Public License for more details.                          |
 
15
|                                                                   |
 
16
| You should have received a copy of the GNU General Public License |
 
17
| along with this program; if not, write to the Free Software       |
 
18
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA          |
 
19
| 02111-1307 USA                                                    |
 
20
`------------------------------------------------------------------*/
 
21
 
 
22
#include "system.h"
 
23
#include "keyb_low.h"
 
24
#include "argv.h"
 
25
#include "errors.h"
 
26
 
 
27
unsigned int keyboard_modifiers;
 
28
unsigned char keyboard_map[HKEY_MAX + 1];
 
29
 
 
30
void
 
31
init_keyboard_map (void)
 
32
{
 
33
  int i;
 
34
 
 
35
  for (i = HKEY_MAX; i >= 0; i--)
 
36
    keyboard_map[i] = 0;
 
37
  keyboard_modifiers = 0;
 
38
}
 
39
 
 
40
void
 
41
uninit_keyboard_map (void)
 
42
{
 
43
}
 
44
 
 
45
int
 
46
mouse_coord_x (void)
 
47
{
 
48
  update_mouse_state ();
 
49
  return mouse_pos_x / stretch;
 
50
}
 
51
 
 
52
int
 
53
mouse_coord_y (void)
 
54
{
 
55
  update_mouse_state ();
 
56
  return mouse_pos_y / stretch;
 
57
}
 
58
 
 
59
char
 
60
mouse1 (void)
 
61
{
 
62
  update_mouse_state ();
 
63
  return mouse_button_left;
 
64
}
 
65
 
 
66
char
 
67
mouse2 (void)
 
68
{
 
69
  update_mouse_state ();
 
70
  return mouse_button_right;
 
71
}
 
72
 
 
73
char
 
74
mouse3 (void)
 
75
{
 
76
  update_mouse_state ();
 
77
  return mouse_button_middle;
 
78
}
 
79
 
 
80
/* FIXME: this should be renamed */
 
81
char
 
82
mouse12 (void)
 
83
{
 
84
  update_mouse_state ();
 
85
  return mouse_button_left || mouse_button_right || mouse_button_middle;
 
86
}