mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
CPEvent - send a valid timestamp for periodic events
This commit is contained in:
+1
-1
@@ -634,7 +634,7 @@ var _CPEventPeriodicEventPeriod = 0,
|
||||
|
||||
function _CPEventFirePeriodEvent()
|
||||
{
|
||||
[CPApp sendEvent:[CPEvent otherEventWithType:CPPeriodic location:_CGPointMakeZero() modifierFlags:0 timestamp:0 windowNumber:0 context:nil subtype:0 data1:0 data2:0]];
|
||||
[CPApp sendEvent:[CPEvent otherEventWithType:CPPeriodic location:_CGPointMakeZero() modifierFlags:0 timestamp:[CPEvent currentTimestamp] windowNumber:0 context:nil subtype:0 data1:0 data2:0]];
|
||||
}
|
||||
|
||||
var CPEventClass = [CPEvent class];
|
||||
|
||||
@@ -126,8 +126,8 @@ var STICKY_TIME_INTERVAL = 0.5,
|
||||
}
|
||||
|
||||
if (_keyBuffer)
|
||||
{ // periodic events have a timestamp of 0 so use the currentTimestamp
|
||||
if (([CPEvent currentTimestamp] - _startTime) > (STICKY_TIME_INTERVAL + [activeMenu numberOfItems] / 2))
|
||||
{
|
||||
if (([anEvent timestamp] - _startTime) > (STICKY_TIME_INTERVAL + [activeMenu numberOfItems] / 2))
|
||||
[self selectNextItemBeginningWith:_keyBuffer inMenu:menu clearBuffer:YES];
|
||||
|
||||
if (type === CPPeriodic)
|
||||
@@ -245,7 +245,7 @@ var STICKY_TIME_INTERVAL = 0.5,
|
||||
|
||||
3. The user clicks, drags and then releases. Tracking ends.
|
||||
*/
|
||||
if (_mouseWasDragged || ([CPEvent currentTimestamp] - _startTime > STICKY_TIME_INTERVAL))
|
||||
if (_mouseWasDragged || ([anEvent timestamp] - _startTime > STICKY_TIME_INTERVAL))
|
||||
{
|
||||
/*
|
||||
Close the menu if:
|
||||
@@ -485,7 +485,7 @@ var STICKY_TIME_INTERVAL = 0.5,
|
||||
{
|
||||
if (!_keyBuffer)
|
||||
{
|
||||
_startTime = [CPEvent currentTimestamp];
|
||||
_startTime = [anEvent timestamp];
|
||||
_keyBuffer = character;
|
||||
|
||||
[CPEvent stopPeriodicEvents];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CPMenu
|
||||
* CPMenuTest
|
||||
*
|
||||
* Created by Blair Duncan on April 23, 2012.
|
||||
* Copyright 2012, SGL Studio, BBDO Toronto All rights reserved.
|
||||
|
||||
Reference in New Issue
Block a user