Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
67e7b4e5
Commit
67e7b4e5
authored
20 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Replace all the "current" bits of the mouse state with an array of per-button
states.
parent
98861148
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/conio/mouse.c
+13
-10
13 additions, 10 deletions
src/conio/mouse.c
with
13 additions
and
10 deletions
src/conio/mouse.c
+
13
−
10
View file @
67e7b4e5
...
@@ -26,6 +26,17 @@ struct out_mouse_event {
...
@@ -26,6 +26,17 @@ struct out_mouse_event {
void
*
nextevent
;
void
*
nextevent
;
};
};
struct
curr_event
{
int
event
;
/* Current event (if successfull)
* ie: If you're already clicked, and not moved, a double-click
* is the "Current Event" */
int
sx
;
/* Current event start x */
int
sy
;
/* Current event start y */
clock_t
ts
;
/* msclock() time this event will finish
* ie: When double-click is current, release+timeout or
* press+timeout */
}
struct
mouse_state
{
struct
mouse_state
{
int
buttonstate
;
/* Current state of all buttons */
int
buttonstate
;
/* Current state of all buttons */
int
knownbuttonstatemask
;
/* Mask of buttons that have done something since */
int
knownbuttonstatemask
;
/* Mask of buttons that have done something since */
...
@@ -39,15 +50,7 @@ struct mouse_state {
...
@@ -39,15 +50,7 @@ struct mouse_state {
int
click_drift
;
/* Allowed "drift" during a click event */
int
click_drift
;
/* Allowed "drift" during a click event */
struct
in_mouse_event
*
events_in
;
/* Pointer to recevied events stack */
struct
in_mouse_event
*
events_in
;
/* Pointer to recevied events stack */
struct
out_mouse_event
*
events_out
;
/* Pointer to output events stack */
struct
out_mouse_event
*
events_out
;
/* Pointer to output events stack */
int
b1_currevent
;
/* Event that is currently being processed on button 1 */
struct
curr_event
pending
[
3
];
/* Per-button pending events */
int
b1_ce_sx
;
/* Start X for current b1 event */
int
b1_ce_sy
;
/* Start Y for current b1 event */
int
b2_currevent
;
int
b2_ce_sx
;
/* Start X for current b2 event */
int
b2_ce_sy
;
/* Start Y for current b2 event */
int
b3_currevent
;
int
b3_ce_sx
;
/* Start X for current b3 event */
int
b3_ce_sy
;
/* Start Y for current b3 event */
};
};
struct
mouse_state
state
;
struct
mouse_state
state
;
...
@@ -136,7 +139,7 @@ static void add_outevent(int event, int bstate, int kbsm, sx, sy, ex, ey)
...
@@ -136,7 +139,7 @@ static void add_outevent(int event, int bstate, int kbsm, sx, sy, ex, ey)
pthread_mutex_unlock
(
&
in_mutex
);
pthread_mutex_unlock
(
&
in_mutex
);
}
}
static
void
c
o
ilib_mouse_thread
(
void
*
data
)
static
void
ci
o
lib_mouse_thread
(
void
*
data
)
{
{
int
use_timeout
=
0
;
int
use_timeout
=
0
;
struct
timespec
timeout
;
struct
timespec
timeout
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment