mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-12 18:16:40 +02:00
more CR changes
This commit is contained in:
parent
f3fad52e1d
commit
089a223c2d
3 changed files with 14 additions and 35 deletions
|
@ -488,6 +488,10 @@ void Keyboard::switchToLayer(int layerIndex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Keyboard::shouldProcessOverlayAndPointerEvent(const PointerEvent& event, const OverlayID& overlayID) const {
|
||||||
|
return (shouldProcessPointerEvent(event) && shouldProcessOverlay(overlayID));
|
||||||
|
}
|
||||||
|
|
||||||
bool Keyboard::shouldProcessPointerEvent(const PointerEvent& event) const {
|
bool Keyboard::shouldProcessPointerEvent(const PointerEvent& event) const {
|
||||||
bool preferMalletsOverLasers = getPreferMalletsOverLasers();
|
bool preferMalletsOverLasers = getPreferMalletsOverLasers();
|
||||||
unsigned int pointerID = event.getID();
|
unsigned int pointerID = event.getID();
|
||||||
|
@ -497,12 +501,8 @@ bool Keyboard::shouldProcessPointerEvent(const PointerEvent& event) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Keyboard::handleTriggerBegin(const OverlayID& overlayID, const PointerEvent& event) {
|
void Keyboard::handleTriggerBegin(const OverlayID& overlayID, const PointerEvent& event) {
|
||||||
if (getExitEarly(overlayID)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto buttonType = event.getButton();
|
auto buttonType = event.getButton();
|
||||||
if (!shouldProcessPointerEvent(event) || buttonType != PointerEvent::PrimaryButton) {
|
if (!shouldProcessOverlayAndPointerEvent(event, overlayID) || buttonType != PointerEvent::PrimaryButton) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,11 +608,7 @@ void Keyboard::setRightHandLaser(unsigned int rightHandLaser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Keyboard::handleTriggerEnd(const OverlayID& overlayID, const PointerEvent& event) {
|
void Keyboard::handleTriggerEnd(const OverlayID& overlayID, const PointerEvent& event) {
|
||||||
if (getExitEarly(overlayID)) {
|
if (!shouldProcessOverlayAndPointerEvent(event, overlayID)) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!shouldProcessPointerEvent(event)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -641,11 +637,7 @@ void Keyboard::handleTriggerEnd(const OverlayID& overlayID, const PointerEvent&
|
||||||
}
|
}
|
||||||
|
|
||||||
void Keyboard::handleTriggerContinue(const OverlayID& overlayID, const PointerEvent& event) {
|
void Keyboard::handleTriggerContinue(const OverlayID& overlayID, const PointerEvent& event) {
|
||||||
if (getExitEarly(overlayID)) {
|
if (!shouldProcessOverlayAndPointerEvent(event, overlayID)) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!shouldProcessPointerEvent(event)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -684,11 +676,7 @@ void Keyboard::handleTriggerContinue(const OverlayID& overlayID, const PointerEv
|
||||||
}
|
}
|
||||||
|
|
||||||
void Keyboard::handleHoverBegin(const OverlayID& overlayID, const PointerEvent& event) {
|
void Keyboard::handleHoverBegin(const OverlayID& overlayID, const PointerEvent& event) {
|
||||||
if (getExitEarly(overlayID)) {
|
if (!shouldProcessOverlayAndPointerEvent(event, overlayID)) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!shouldProcessPointerEvent(event)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -704,11 +692,7 @@ void Keyboard::handleHoverBegin(const OverlayID& overlayID, const PointerEvent&
|
||||||
}
|
}
|
||||||
|
|
||||||
void Keyboard::handleHoverEnd(const OverlayID& overlayID, const PointerEvent& event) {
|
void Keyboard::handleHoverEnd(const OverlayID& overlayID, const PointerEvent& event) {
|
||||||
if (getExitEarly(overlayID)) {
|
if (!shouldProcessOverlayAndPointerEvent(event, overlayID)) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!shouldProcessPointerEvent(event)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -927,8 +911,8 @@ void Keyboard::loadKeyboardFile(const QString& keyboardFile) {
|
||||||
request->send();
|
request->send();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Keyboard::getExitEarly(OverlayID overlayID) const {
|
bool Keyboard::shouldProcessOverlay(const OverlayID& overlayID) const {
|
||||||
return (_keyboardLayers.empty() || !isLayerSwitchTimerFinished() || overlayID == _backPlate.overlayID);
|
return (!_keyboardLayers.empty() && isLayerSwitchTimerFinished() && overlayID != _backPlate.overlayID);
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<OverlayID> Keyboard::getKeysID() {
|
QVector<OverlayID> Keyboard::getKeysID() {
|
||||||
|
|
|
@ -152,13 +152,13 @@ private:
|
||||||
void clearKeyboardKeys();
|
void clearKeyboardKeys();
|
||||||
void switchToLayer(int layerIndex);
|
void switchToLayer(int layerIndex);
|
||||||
void updateTextDisplay();
|
void updateTextDisplay();
|
||||||
bool getExitEarly(OverlayID overlayID) const;
|
bool shouldProcessOverlayAndPointerEvent(const PointerEvent& event, const OverlayID& overlayID) const;
|
||||||
|
bool shouldProcessPointerEvent(const PointerEvent& event) const;
|
||||||
|
bool shouldProcessOverlay(const OverlayID& overlayID) const;
|
||||||
|
|
||||||
void startLayerSwitchTimer();
|
void startLayerSwitchTimer();
|
||||||
bool isLayerSwitchTimerFinished() const;
|
bool isLayerSwitchTimerFinished() const;
|
||||||
|
|
||||||
bool shouldProcessPointerEvent(const PointerEvent& event) const;
|
|
||||||
|
|
||||||
bool _raised { false };
|
bool _raised { false };
|
||||||
bool _password { false };
|
bool _password { false };
|
||||||
bool _capsEnabled { false };
|
bool _capsEnabled { false };
|
||||||
|
|
|
@ -246,11 +246,6 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
} else if ((type === intersectionType["HifiKeyboard"] && laserOn) || type === intersectionType["Overlay"]) {
|
} else if ((type === intersectionType["HifiKeyboard"] && laserOn) || type === intersectionType["Overlay"]) {
|
||||||
this.running = true;
|
this.running = true;
|
||||||
return makeRunningValues(true, [], []);
|
return makeRunningValues(true, [], []);
|
||||||
} else if (isTriggerPressed && !this.getInteractableType(controllerData, isTriggerPressed, true)) {
|
|
||||||
// if trigger is down + not pointing at a web entity, keep running web surface laser
|
|
||||||
this.running = true;
|
|
||||||
return makeRunningValues(true, [], []);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.deleteContextOverlay();
|
this.deleteContextOverlay();
|
||||||
|
|
Loading…
Reference in a new issue