sync to rev 1.62 from OT rep: use the event time instead of the current system time for appending or starting a new match when typing ahead to select a pose
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17930 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
fe7f3a2f1d
commit
f8262c2b19
@ -5928,16 +5928,23 @@ BPoseView::KeyDown(const char *bytes, int32 count)
|
||||
return;
|
||||
}
|
||||
|
||||
// figure out the time at which the keypress happened
|
||||
bigtime_t eventTime;
|
||||
BMessage* message = Window()->CurrentMessage();
|
||||
if (!message || message->FindInt64("when", &eventTime) < B_OK) {
|
||||
eventTime = system_time();
|
||||
}
|
||||
|
||||
// add char to existing matchString or start new match string
|
||||
// make sure we don't overfill matchstring
|
||||
if (system_time() - fLastKeyTime < (doubleClickSpeed * 2)) {
|
||||
if (eventTime - fLastKeyTime < (doubleClickSpeed * 2)) {
|
||||
uint32 nchars = B_FILE_NAME_LENGTH - strlen(fMatchString);
|
||||
strncat(fMatchString, searchChar, nchars);
|
||||
} else {
|
||||
strncpy(fMatchString, searchChar, B_FILE_NAME_LENGTH - 1);
|
||||
}
|
||||
fMatchString[B_FILE_NAME_LENGTH - 1] = '\0';
|
||||
fLastKeyTime = system_time();
|
||||
fLastKeyTime = eventTime;
|
||||
|
||||
fCountView->SetTypeAhead(fMatchString);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user