Skip to content

Commit

Permalink
Add an optional pop-up notification when auto-turn is toggled (#496)
Browse files Browse the repository at this point in the history
* Implement (most of) pop-up notification when autoturn is enabled

* Add neato fading: doesn't appear to impact performance

* formatting

* added macro and UI for notification of auto-turn

* changed notification default to true for auto-turn

* added common issue for trackers

* added warning for custom keys

* minor documentation markdown format fixes

* fix qml syntax error in atgb

* gasd

Co-authored-by: ykeara <[email protected]>
  • Loading branch information
feilen and ykeara authored Aug 12, 2020
1 parent 90d980d commit 6d19530
Show file tree
Hide file tree
Showing 13 changed files with 324 additions and 32 deletions.
12 changes: 10 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Detailed instructions are available [here](docs/building_for_linux.md).

### Overall Feature Overview Guides

- [Kung's 3.0 New Feature Guide (video/youtube)[https://youtu.be/2ZHdjOfnqOU)]
- [Kung's 3.0 New Feature Guide (video/youtube)[https://youtu.be/2ZHdjOfnqOU]

### SteamVR Input System (keybinds for app)

Expand Down Expand Up @@ -472,7 +472,7 @@ Allows users to temporarily move and rotate the center of the playspace. This al
- **Brightness**: Same as regular.
- **Opacity**: Adjusts opacity of color overlay.
- **Toggle On/Off**: Turns on/off Color Adjustment Overlay.
- **<Color>**: Adjusts the overlay to adjust the color.
- **Color (Red/Green/Blue)**: Adjusts the overlay to adjust the color.

## - Utilities Page

Expand Down Expand Up @@ -546,6 +546,14 @@ Full build instructions can be found [here](docs/building_for_linux.md).
- **Cause:** WMR boundary off, or set up for standing only.
- **Solution:** Please set-up WMR for all experiences, and then if you don't want WMR boundary you can toggle off the boundary **after** SteamVR/OpenVR has been started.

- **Issue:** While using Trackers (additional devices besides controllers) Keybinds don't work.
- **Cause:** Trackers can Assume controller roles, and prevent your controllers from working properly.
- **Solution:** Assign Tracker Roles Via SteamVR Widget to anything besides `held-in-hand`

- **Issue:** Custom Key Presses Not Saving In file.
- **Cause:** Key Presses Modified while Advanced Settings is running.
- **Solution:** Only modify the settings file while VR/Advanced Settings is **not** running.

# License

This software is released under GPL 3.0, and other third-party Licenses
6 changes: 5 additions & 1 deletion docs/keyboard_input_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
### Case Sensative
- basic characters are all LOWER case, while keys such as ENTER are all UPPER case.

### Custom Keys Not Saving.
- We only load keybinds from file on start-up, and save based on what is in memory (not in file)
- **ONLY** edit the settings file while Advanced Settings is **not** running.

### Focus Issues
- we deliver the keypress to the OS, depending on your set-up and program you may have to have the window "in-focus"

Expand All @@ -126,4 +130,4 @@
- alt + tab, alt + F4 = `*TAB *F4`

## Parser Spec
(Parser Spec)[https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/blob/master/docs/specs/Keyboard_Manager-Parser_Spec.md]
[Parser Spec](https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/blob/master/docs/specs/Keyboard_Manager-Parser_Spec.md)
Binary file added src/res/img/rotation/autoturn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/res/img/rotation/noautoturn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
120 changes: 120 additions & 0 deletions src/res/img/rotation/noautoturn.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 29 additions & 14 deletions src/res/qml/rotation_page/redirected/AutoTurnGroupBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,18 @@ GroupBox {
MyToggleButton {
id: autoTurn
text: "Toggle On/Off"
Layout.preferredWidth: 300
Layout.preferredWidth: 250
onCheckedChanged: {
RotationTabController.setAutoTurnEnabled(this.checked, true); }
}
MyToggleButton {
id: autoTurnNotificationToggle
text: "HMD Icon"
Layout.preferredWidth: 175
onCheckedChanged: {
RotationTabController.setAutoTurnShowNotification(this.checked, true)
}
}

MyText {
text: "Activation Dist:"
Expand Down Expand Up @@ -160,7 +168,7 @@ GroupBox {
}

MyText {
text: "Turn Speed (deg/sec):"
text: "Turn Speed(deg/sec):"
horizontalAlignment: Text.AlignRight
Layout.rightMargin: 10
}
Expand All @@ -174,7 +182,7 @@ GroupBox {
Layout.fillWidth: true
onPositionChanged: {
var val = this.value
speedValueText.text = val.toFixed()
speedValueText.text = val.toFixed()+ "°"
}
onValueChanged: {

Expand All @@ -184,7 +192,7 @@ GroupBox {

MyTextField {
id: speedValueText
text: "90"
text: "90°"
keyBoardUID: 1003
Layout.preferredWidth: 100
Layout.leftMargin: 10
Expand All @@ -203,29 +211,30 @@ GroupBox {
speedSlider.value = val;
}
//converts the centidegrees to degrees
text = (((RotationTabController.autoTurnSpeed)/100).toFixed());
text = (((RotationTabController.autoTurnSpeed)/100).toFixed()) + "°";
}
}


}
RowLayout{

MyText{
text: "Detangle Angle: "
horizontalAlignment: Text.AlignLeft
Layout.preferredWidth: 250
Layout.preferredWidth: 200
Layout.rightMargin: 5

}
MyText{
text:"Min Rotations(deg):"
text:"Min Rotations:"
Layout.rightMargin: 5

}

MyTextField {
id: detangleAngleStartText
text: "360"
text: "360°"
keyBoardUID: 1005
Layout.preferredWidth: 100
Layout.leftMargin: 5
Expand All @@ -239,6 +248,7 @@ GroupBox {
val = 3600
}
RotationTabController.setMinCordTangle((val*(Math.PI/180)), true);
text = (Math.round(val).toFixed())+ "°";
}
}
}
Expand All @@ -247,15 +257,15 @@ GroupBox {
}

MyText{
text: "Max Wall Angle(deg): "
text: "Max Wall Angle: "
horizontalAlignment: Text.AlignRight
Layout.rightMargin: 10
Layout.fillWidth: true

}
MyTextField {
id: detangleAngleAssistText
text: "10"
text: "10°"
keyBoardUID: 1006
Layout.preferredWidth: 100
Layout.leftMargin: 10
Expand All @@ -269,6 +279,7 @@ GroupBox {
val = 3600
}
RotationTabController.setCordDetangleAngle((val*(Math.PI/180)), true);
text = (Math.round(val).toFixed())+ "°";
}
}
}
Expand All @@ -285,6 +296,7 @@ GroupBox {
deactivationSlider.value = RotationTabController.autoTurnDeactivationDistance.toFixed(2)
cornerAngle.checked = RotationTabController.autoTurnUseCornerAngle
speedSlider.value = (RotationTabController.autoTurnSpeed/100).toFixed()
autoTurnNotificationToggle.checked = RotationTabController.autoTurnShowNotification
if(RotationTabController.autoTurnMode === 1){

autoTurnModeToggle.checked = true;
Expand All @@ -293,8 +305,8 @@ GroupBox {

autoTurnModeToggle.checked = false;
}
detangleAngleStartText.text = parseInt(RotationTabController.minCordTangle*(180/Math.PI))
detangleAngleAssistText.text = parseInt(RotationTabController.cordDetangleAngle*(180/Math.PI))
detangleAngleStartText.text = parseInt(RotationTabController.minCordTangle*(180/Math.PI))+ "°"
detangleAngleAssistText.text = parseInt(RotationTabController.cordDetangleAngle*(180/Math.PI))+ "°"
}

Connections {
Expand Down Expand Up @@ -327,10 +339,13 @@ GroupBox {
}
}
onMinCordTangleChanged:{
detangleAngleStartText.text = parseInt(RotationTabController.minCordTangle*(180/Math.PI))
detangleAngleStartText.text = parseInt(RotationTabController.minCordTangle*(180/Math.PI))+ "°"
}
onCordDetangleAngleChanged:{
detangleAngleAssistText.text = parseInt(RotationTabController.cordDetangleAngle*(180/Math.PI))
detangleAngleAssistText.text = parseInt(RotationTabController.cordDetangleAngle*(180/Math.PI))+ "°"
}
onAutoTurnShowNotificationChanged:{
autoTurnNotificationToggle.checked = RotationTabController.autoTurnShowNotification
}
}
}
4 changes: 4 additions & 0 deletions src/settings/internal/settings_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,10 @@ class SettingsController
SettingCategory::Rotation,
QtInfo{ "autoturnVestibularMotionEnabled" },
false },
BoolSettingValue{ BoolSetting::ROTATION_autoturnShowNotification,
SettingCategory::Rotation,
QtInfo{ "autoturnShowNotification" },
true }
};

constexpr static auto doubleSettingSize
Expand Down
3 changes: 2 additions & 1 deletion src/settings/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ enum class BoolSetting
ROTATION_autoturnEnabled,
ROTATION_autoturnUseCornerAngle,
ROTATION_autoturnVestibularMotionEnabled,
ROTATION_autoturnShowNotification,
// LAST_ENUMERATOR must always be set to the last value
LAST_ENUMERATOR = ROTATION_autoturnVestibularMotionEnabled,
LAST_ENUMERATOR = ROTATION_autoturnShowNotification,
};

enum class DoubleSetting
Expand Down
16 changes: 2 additions & 14 deletions src/tabcontrollers/AudioTabController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,6 @@ void AudioTabController::initStage1()
eventLoopTick();
}

std::optional<std::string> verifyIconFilePath( std::string filename )
{
const auto notifIconPath = paths::binaryDirectoryFindFile( filename );
if ( !notifIconPath.has_value() )
{
LOG( ERROR ) << "Could not find push to talk icon \"" << filename
<< "\"";
}

return notifIconPath;
}

void AudioTabController::initStage2()
{
const auto pushToTalkOverlayKey
Expand Down Expand Up @@ -102,9 +90,9 @@ void AudioTabController::initStage2()
= "/res/img/audio/microphone/ptm_notification.png";

const auto pushToTalkIconFilePath
= verifyIconFilePath( pushToTalkIconFilepath );
= paths::verifyIconFilePath( pushToTalkIconFilepath );
const auto pushToMuteIconFilePath
= verifyIconFilePath( pushToMuteIconFilepath );
= paths::verifyIconFilePath( pushToMuteIconFilepath );

if ( !pushToTalkIconFilePath.has_value()
|| !pushToMuteIconFilePath.has_value() )
Expand Down
Loading

0 comments on commit 6d19530

Please sign in to comment.