Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3059)

Issue 2114042: code review 2114042: exp/draw: unify a draw.Context's keyboard, mouse, etc. ... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 7 months ago by nigeltao
Modified:
13 years, 7 months ago
Reviewers:
rog
CC:
r, rsc, nigeltao_gnome, golang-dev
Visibility:
Public.

Description

exp/draw: unify a draw.Context's keyboard, mouse, etc. channels into a single event channel. A quit event is now represented by closing that channel.

Patch Set 1 #

Patch Set 2 : code review 2114042: exp/draw: unify a draw.Context's keyboard, mouse, etc. ... #

Patch Set 3 : code review 2114042: exp/draw: unify a draw.Context's keyboard, mouse, etc. ... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -48 lines) Patch
M src/pkg/exp/draw/event.go View 1 chunk +24 lines, -26 lines 0 comments Download
M src/pkg/exp/draw/x11/conn.go View 5 chunks +9 lines, -22 lines 0 comments Download

Messages

Total messages: 12
nigeltao
Hello r, rsc (cc: golang-dev@googlegroups.com), I'd like you to review this change.
13 years, 7 months ago (2010-09-05 04:25:13 UTC) #1
nigeltao_gnome
The NaCl code under exp will be fixed in a separate change. GOOS=nacl doesn't even ...
13 years, 7 months ago (2010-09-05 04:30:39 UTC) #2
r
We talked about this a little bit did we reach a conclusion? I'm not convinced ...
13 years, 7 months ago (2010-09-05 09:59:58 UTC) #3
nigeltao_gnome
On 5 September 2010 19:59, Rob 'Commander' Pike <r@golang.org> wrote: > We talked about this ...
13 years, 7 months ago (2010-09-05 12:09:39 UTC) #4
r
LGTM with the understanding we might do something totally different later.
13 years, 7 months ago (2010-09-06 01:57:35 UTC) #5
nigeltao
*** Submitted as http://code.google.com/p/go/source/detail?r=3dd6ee3ef9e9 *** exp/draw: unify a draw.Context's keyboard, mouse, etc. channels into a ...
13 years, 7 months ago (2010-09-06 09:22:44 UTC) #6
rog
what happened to the mouse event's timestamp? On 5 September 2010 05:25, <nigeltao@golang.org> wrote: > ...
13 years, 7 months ago (2010-09-07 08:38:01 UTC) #7
nigeltao_gnome
On 7 September 2010 18:37, roger peppe <rogpeppe@gmail.com> wrote: > what happened to the mouse ...
13 years, 7 months ago (2010-09-07 09:15:23 UTC) #8
rog
i have a version that does fill them in (and code that relies on that). ...
13 years, 7 months ago (2010-09-07 09:29:46 UTC) #9
rsc
please keep mouse time stamps. they are the only reliable way to detect a double-click. ...
13 years, 7 months ago (2010-09-07 11:51:42 UTC) #10
nigeltao_gnome
On 7 September 2010 21:51, Russ Cox <rsc@golang.org> wrote: > please keep mouse time stamps. ...
13 years, 7 months ago (2010-09-07 12:53:22 UTC) #11
rog
13 years, 7 months ago (2010-09-07 13:08:16 UTC) #12
On 7 September 2010 13:53, Nigel Tao <nigel.tao.gnome@gmail.com> wrote:
> On 7 September 2010 21:51, Russ Cox <rsc@golang.org> wrote:
>> please keep mouse time stamps.
>> they are the only reliable way to detect
>> a double-click.  using the time that
>> the event is received later on fails badly
>> under load.
>
> OK. X11 gives a uint32 timestamp for some (but not all) events, but
> http://www.x.org/docs/XProtocol/proto.pdf says that it wraps around,
> so I'll just use time.Nanoseconds().

when i did the implementation for this, i used time.Nanoseconds()
for the timestamp of the first mouse event (saving the uint32
timestamp of that event); for any subsequent event e, i used
(e.Timestamp - originalEvent.Timestamp) * 1e6 + originalNanoseconds.

this meant that at least time deltas were millisecond accurate regardless
of network transmission time, although the absolute times will be
subject to a constant offset according to the delay on the first
timestamp. i'm not sure it's possible to do better than that without
estimating network delay.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b