mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-14 16:34:04 +09:00
less CPU demanding InputStrobing
This commit is contained in:
@@ -964,8 +964,10 @@ input.withEvent = function(callback) {
|
||||
inputwork.stroboStatus = 0;
|
||||
inputwork.repeatCount = 0;
|
||||
|
||||
if (keys[0] == 0)
|
||||
if (keys[0] == 0) {
|
||||
inputwork.keyChanged = false;
|
||||
sys.sleep(25)
|
||||
}
|
||||
|
||||
if (keyChanged) {
|
||||
//callback(["key_change", keysToStr(arrayDiff(keys, inputwork.oldKeys)), inputwork.repeatCount].concat(keys));
|
||||
@@ -977,7 +979,7 @@ input.withEvent = function(callback) {
|
||||
}
|
||||
}
|
||||
else if (inputwork.stroboStatus % 2 == 1 && sys.nanoTime() - inputwork.stroboTime < inputwork.stroboDelays[inputwork.stroboStatus]) {
|
||||
sys.spin();
|
||||
sys.sleep(25);
|
||||
}
|
||||
else {
|
||||
inputwork.stroboStatus += 1;
|
||||
|
||||
Reference in New Issue
Block a user