Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
fa92b113
Commit
fa92b113
authored
Sep 07, 2010
by
Nigel Tao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exp/draw: reintroduce the MouseEvent.Nsec timestamp.
R=rsc CC=golang-dev
https://golang.org/cl/2166042
parent
34c312e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
event.go
src/pkg/exp/draw/event.go
+2
-0
conn.go
src/pkg/exp/draw/x11/conn.go
+3
-2
No files found.
src/pkg/exp/draw/event.go
View file @
fa92b113
...
...
@@ -39,6 +39,8 @@ type MouseEvent struct {
Buttons
int
// Loc is the location of the cursor.
Loc
image
.
Point
// Nsec is the event's timestamp.
Nsec
int64
}
// A ConfigEvent is sent each time the window's color model or size changes.
...
...
src/pkg/exp/draw/x11/conn.go
View file @
fa92b113
...
...
@@ -19,6 +19,7 @@ import (
"os"
"strconv"
"strings"
"time"
)
type
resID
uint32
// X resource IDs.
...
...
@@ -208,12 +209,12 @@ func (c *conn) pumper() {
}
else
{
c
.
mouseState
.
Buttons
&^=
mask
}
// TODO(nigeltao): update mouseState's timestamp.
c
.
mouseState
.
Nsec
=
time
.
Nanoseconds
()
c
.
eventc
<-
c
.
mouseState
case
0x06
:
// Motion notify.
c
.
mouseState
.
Loc
.
X
=
int
(
c
.
buf
[
25
])
<<
8
|
int
(
c
.
buf
[
24
])
c
.
mouseState
.
Loc
.
Y
=
int
(
c
.
buf
[
27
])
<<
8
|
int
(
c
.
buf
[
26
])
// TODO(nigeltao): update mouseState's timestamp.
c
.
mouseState
.
Nsec
=
time
.
Nanoseconds
()
c
.
eventc
<-
c
.
mouseState
case
0x0c
:
// Expose.
// A single user action could trigger multiple expose events (e.g. if moving another
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment