-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLC_mouseHandler.h
47 lines (37 loc) · 1.09 KB
/
LC_mouseHandler.h
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
//
// LC_mouseHandler.h
// LocoControl
//
// Created by Chris Draper on 19/06/15.
// Copyright (c) 2015-2019. All rights reserved.
//
// VERSION 2.4.0 released 26/12/2019
#ifndef __LocoControl__LC_mouseHandler__
#define __LocoControl__LC_mouseHandler__
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <SDL2/SDL.h>
#include "LC_globals.h" //definitions that are common across all MPU's in the Loco Sound system
#define MAX_MOUSE_COMMANDS 10 //maximum mouse commands that can be registered at any one time
/*********************************************
*
* Global Variable Declarations
*
*********************************************/
typedef struct {
bool IsActive;
SDL_Event event;
SDL_Rect rect;
} mouseCommand_t;
/*****************************************
*
* Function Prototypes
*
*****************************************/
void handleMouseDown(void);
void actionClick(const int x,const int y);
int registerCommand(SDL_Rect *rect, const char *cmd);
int unregisterCommand(const int idx);
#endif /* defined(__LocoControl__LC_mouseHandler__) */