~ubuntu-branches/ubuntu/trusty/vice/trusty

« back to all changes in this revision

Viewing changes to src/arch/win32/mousedrv.c

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2013-07-28 20:38:23 UTC
  • mfrom: (1.1.10) (9.2.7 sid)
  • Revision ID: package-import@ubuntu.com-20130728203823-1h8s6bcv22oundul
Tags: 2.4.dfsg-1
* New upstream release (closes: #693065, #693641).
* Drop vice-ffmpeg.patch , applied upstream.
* Disable architecture specific compilation (closes: #686400, #714136).

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include "mousedrv.h"
40
40
#include "types.h"
41
41
#include "ui.h"
 
42
#include "vsyncapi.h"
42
43
 
43
44
int _mouse_x, _mouse_y;
 
45
unsigned long _mouse_timestamp = 0;
44
46
 
45
47
#ifdef HAVE_DINPUT
46
48
static int mouse_acquired = 0;
86
88
        }
87
89
    }
88
90
 
89
 
    _mouse_x += state.lX;
90
 
    _mouse_y += state.lY;
 
91
    _mouse_x += state.lX * 4;
 
92
    _mouse_y -= state.lY * 4;
91
93
 
92
94
    mouse_button_left((int)(state.rgbButtons[0] & 0x80));
93
95
    mouse_button_right((int)(state.rgbButtons[1] & 0x80));
 
96
    mouse_button_middle((int)(state.rgbButtons[2] & 0x80));
 
97
    /* FIXME: back/forward buttons as up/down? Or state.lZ increase/decrease?
 
98
    mouse_button_up((int)(state.rgbButtons[3] & 0x80));
 
99
    mouse_button_down((int)(state.rgbButtons[4] & 0x80));
 
100
    */
 
101
    _mouse_timestamp = vsyncarch_gettime();
94
102
#endif
95
103
}
96
104
 
161
169
#endif
162
170
}
163
171
 
164
 
BYTE mousedrv_get_x(void)
165
 
{
166
 
    if (!_mouse_enabled) {
167
 
        return 0xff;
168
 
    }
169
 
    return (BYTE)(_mouse_x >> 1) & 0x7e;
170
 
}
171
 
 
172
 
BYTE mousedrv_get_y(void)
173
 
{
174
 
    if (!_mouse_enabled) {
175
 
        return 0xff;
176
 
    }
177
 
    return (BYTE)(~_mouse_y >> 1) & 0x7e;
 
172
int mousedrv_get_x(void)
 
173
{
 
174
    return _mouse_x >> 1;
 
175
}
 
176
 
 
177
int mousedrv_get_y(void)
 
178
{
 
179
    return _mouse_y >> 1;
 
180
}
 
181
 
 
182
unsigned long mousedrv_get_timestamp(void)
 
183
{
 
184
    return _mouse_timestamp;
178
185
}