Skip to content

Commit

Permalink
Keyboard And Documentation update (#469)
Browse files Browse the repository at this point in the history
* changed action names

* updated settings for new action key

* updated keyboard input guide

* updated readme top

* updated appveyor link

* fixed qml issue and some formatting

* updated screenshots

* updated documentation portion of readme

* fix qml issues
  • Loading branch information
ykeara authored Jun 6, 2020
1 parent 3857c2a commit 88a1c00
Show file tree
Hide file tree
Showing 20 changed files with 211 additions and 110 deletions.
50 changes: 38 additions & 12 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Adds an overlay to the OpenVR dashboard that allows access to advanced settings
* [AppImage](#appimage)
* [Arch/Manjaro](#archmanjaro)
* [Building from Source](#building-from-source)
* [Guides](#guides)
* [Bindings](#bindings)
* [Music](#music)
* [Motion](#motion)
Expand All @@ -33,7 +34,6 @@ Adds an overlay to the OpenVR dashboard that allows access to advanced settings
* [WMR](#wmr)
* [Touch](#touch)
* [Other Controllers](#other-controllers)
* [SteamVR Input Guide](#steamvr-input-guide)
* [Command Line Arguments](#command-line-arguments)
* [INI File Options](#ini-file-options)
* [Preview builds](#preview-builds)
Expand Down Expand Up @@ -80,7 +80,8 @@ Do all this without leaving VR:
- Advanced Space Features: gravity, space-turn, and space-drag
- Control media players (Pause/Play, Next Song, Previous Song, Stop).
- Send keyboard inputs (like Alt+Tab, Alt+Enter, Backspace, etc.).
- Bind VR controller buttons to send keyboard inputs (for example to mute VOIP applications while in VR). [Tutorial](docs/keyboard_input_guide.md).
- Bind VR controller buttons to send keyboard inputs (for example to mute VOIP applications while in VR).
- Center Marker with rotation indicator.
- All the above also available from a window on the desktop.

# Usage
Expand Down Expand Up @@ -120,9 +121,23 @@ Manjaro users can [enable](https://wiki.manjaro.org/index.php/Arch_User_Reposito

Detailed instructions are available [here](docs/building_for_linux.md).

## Guides

### Overall Feature Overview Guides

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

### SteamVR Input System (keybinds for app)

- [Steam VR Input System (text)](docs/SteamVRInputGuide.md)

### Keyboard Binding System

- [Keyboard Input Guide (text)](docs/keyboard_input_guide.md)

## Bindings

For information on how to properly set-up bindings see: [SteamVR Input Guide](#steamvr-input-guide)
For information on how to properly set-up bindings see: [SteamVR Input System Guide](#guides)

The following actions currently exist:
### Music
Expand Down Expand Up @@ -174,10 +189,10 @@ Actions that don't have a clear category.
| Y-Axis Lock Toggle | Binary/Button | Toggles the lock of the Y-Axis for offsets.|
| Z-Axis Lock Toggle | Binary/Button | Toggles the lock of the Z-Axis for offsets.|
| Chaperone Toggle | Binary/Button | Toggles the chaperone on/off. |
| Push to Talk | Binary/Button | Acts as starter for PTT, can mute if push-to-mute is selected.|
| Keyboard Shortcut One | Binary/Button | Sends the key sequence defined the the settings file. Defaults to Ctrl+Shift+M (Discord default toggle mute). |
| Keyboard Shortcut Two | Binary/Button | Sends the key sequence defined the the settings file. This has no default sequence. |
| Keyboard Shortcut Three | Binary/Button | Sends the key sequence defined the the settings file. This has no default sequence. |
| Key Press Misc | Binary/Button | Sends the key press defined in the settings file. Defaults to F9 |


### System.
Expand All @@ -187,8 +202,10 @@ Actions That will stay active regardless of the situation.

| Action | Type | Explanation |
| ------------- | ------------- | ------------ |
| Push to Talk | Binary/Button | Acts as starter for PTT, can mute if push-to-mute is selected.|
| Add Left Haptic Click | Binary/Button | simulates a "click" with controller haptics. (left hand)
| Add Right Haptic Click | Binary/Button | simulates a "click" with controller haptics. (right hand)
| Key Press System | Binary/Button | Sends the key press defined in the settings file. Defaults to F9 |

### Haptics.

Expand Down Expand Up @@ -247,12 +264,6 @@ These Actions are Hidden, They are bound by default. They allow the application
No current default bindings you will have to make your own.


## SteamVR Input Guide

A Guide to the SteamVR Input System can be found [here](docs/SteamVRInputGuide.md)

**Or** a Video guide by Kung can be found [here](https://youtu.be/2ZHdjOfnqOU)

## Command Line Arguments

The application (`AdvancedSettings.exe`) can be run with the following optional arguments:
Expand All @@ -267,6 +278,8 @@ The application (`AdvancedSettings.exe`) can be run with the following optional

`"--force-remove-manifest"`: Force uninstalls the `.vrmanifest`. This should be done every time the application is uninstalled. On Windows it is automatically done by the uninstaller. The program will exit early when this flag is set.

`"--reset-steamvr-settings"`: Resets the SteamVR settings we adjust to Steam's Default Values.

## INI File Options

There are some features that can only be enabled by directly specifying them in the .ini file. On windows the .ini file can be found at `Users\username\AppData\Roaming\AdvancedSettings-Team\OpenVRAdvancedSettings.ini`.
Expand All @@ -285,7 +298,7 @@ Under `[applicationSettings]` adding `enableDebug=true` will show a "Debug State

## Preview builds

If you want to try latest and greatest unreleased features, you can download the latest from the CI (Continuous Integration) server for [Windows](https://ci.appveyor.com/project/icewind1991/openvr-advancedsettings/branch/master) and [Linux](https://circleci.com/gh/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings) (`gcc` build, CircleCI issue requires login to see artifact tab).
If you want to try latest and greatest unreleased features, you can download the latest from the CI (Continuous Integration) server for [Windows](https://ci.appveyor.com/project/OVRAdvancedSettings/openvr-advancedsettings/branch/master)and [Linux](https://circleci.com/gh/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings) (`gcc` build, CircleCI issue requires login to see artifact tab).

These version are not stable and this should be considered for advanced users only.

Expand Down Expand Up @@ -315,7 +328,6 @@ These version are not stable and this should be considered for advanced users on
- **Camera for Bounds**: Your camera view will replace your vr view as you near/exit chaperone
- **Camera for Dashboard**: You will have a small camera view attached to your controller when you have the dashboard active.
- **Camera for Room View**: You will have a Tron/Shadow version of the room when double-clicking system button.
- **Desktop Overlay Width**: Adjusts teh width of Steam's desktop overlay.
- **Restart SteamVR**: Restart SteamVR (May crash the Steam overlay when SteamVR Home is running when you restart. Therefore I advice that you close SteamVR Home before restarting).

## - Chaperone Page
Expand All @@ -334,6 +346,17 @@ These version are not stable and this should be considered for advanced users on
- **Rotate Orientation**: Rotates the orientation by a set amount.
- **Reload from Disk**: Reloads the chaperone bounds geometry from disk.

## - Additional Chaperone Settings Page

<img src="docs/screenshots/ChaperoneAdditionalPage.png" width="600" alt="Chaperone Additional Page">

- **Chaperone Color**: Adjust the R, G, and B color channels of the chaperone.
- **Chaperone Styles**: Adjust the appearance of the Chaperone.
- **Misc:**
- **Floor Bounds Always On**: Forces floor bounds to always show.
- **Legacy Center Marker**: Old Center Marker, does not move with motion or indicate rotation.
- **Reset Turn Counter**: Re-zero's turn counter for center marker turn indicators, based on current HMD orientation.

## - Chaperone Proximity Warning Settings Page

<img src="docs/screenshots/ChaperoneWarningPage.png" width="600" alt="Chaperone Proximity Warning Settings Page">
Expand Down Expand Up @@ -486,7 +509,10 @@ Allows users to temporarily move and rotate the center of the playspace. This al
- **Enable Motion Features When in Seated Mode:** Uncheck this if Advanced Settings causes strange positioning in a seated application. (Different apps handle seated mode in different ways, some are less compatible with Advanced Settings). Note: if unchecked, all Space Offsets and Motion tab features will be disabled.
- **Disable Automatic Crash Recovery of Chaperone Config:** This prevents applying of the last good autosaved chaperone profile when starting up after not shutting down properly.
- **Disable Notification of Newer Version Availability**: This turns off the on start-up check for a new version. (You can refresh this to do a manual check.)
- **Force Use SteamVR Chaperone**: This feature is currently experimental, when using third party headsets this will allow you to use SteamVR's chaperone, as if it was a native headset.
- **Force Use SteamVR (Disable Oculus API)**: This feature is currently experimental, it should disable Oculus API preventing games with both SteamVR and Oculus API to only run as SteamVR
- **Disable App Vsync:** Allows setting a custom base update rate for Advanced Settings. (Might be useful on HMDs with very high or very low refresh rates).
- **Shutdown OVRAS** Shuts-Down Advanced Settings without closing out of VR.

# How to Compile

Expand Down
183 changes: 128 additions & 55 deletions docs/keyboard_input_guide.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,128 @@
## Sending keypresses from VR to the desktop

The `Keyboard Shortcut One`, `Keyboard Shortcut Two` and `Keyboard Shortcut Three` actions under the `misc` tab will send the currently configured key sequence to the operating system.

The default keybinding for all three actions is `Ctrl+Shift+M`, which mutes your microphone in Discord (unless you've changed it).
This sequence can be changed to anything you want, as described in the [spec](specs/Keyboard_Manager-Parser_Spec.md).
An easier to read version of the spec can be found below.

The hotkeys can for example be configured to run an AutoHotKey script or mute VOIP applications.

### Changing the key sequences

Currently, the only way to change which sequences are run when the bindings are activated is directly through the settings file.

On Windows the settings file can be found in `%APPDATA%\AdvancedSettings-Team` (copy paste this into Explorer or the Run command).

On Linux the settings file can be found in `~/.config/AdvancedSettings-Team/`.

The `OpenVRAdvancedSettings.ini` file will contain a heading like
```
[keyboardShortcuts]
keyboardOne=^>m
keyboardTwo=^>m
keyboardThree=^>m
```
The character _after_ the `=` will be run when the related binding is activated.
The above key sequence for all bindings is `^>m` (`Ctrl+Shift+M`).
An empty binding (no input will be run) would be `keyboardOne=`.

### Simple Configuration

Simply changing the last key of the default bindings should be enough for most people.
Remember that you will also need to set up the application (Discord, Mumble, TeamSpeak, etc.) to respond to the key sequence.
Single characters _must_ be lower case.
If you enter them as uppercase it will be treated as an error, and only correct keys up to the error point will be sent to the OS.

The default configuration is `^>m` for all bindings. Change the letter (`m`) to the character you want.
For example, if you want Keyboard Shortcut Two to be `Ctrl+Shift+X` you would write `keyboardTwo=^>x`.
If you just want it to be `Ctrl+X` you would remove the `>` symbol and just write `keyboardTwo=^m`.

Notice that all pressed keys are released again when the sequence is over.
It is not possible to hold down keys.

### Advanced Configuration

Look at the key table [spec](specs/Keyboard_Manager-Parser_Spec.md) and find the keys that you want to press.

Notice that single characters (a, b, c, etc.) are lower case, while buttons are uppercase (ENTER, END, ESC, etc.).
If you enter single letters as upper case it will not work.
Buttons are pressed and released immediately, modifiers are held until there's a space in the sequence or the sequence ends.

The modifier keys should come before the "real" button inputs.
`^m` (`Ctrl+M` (Ctrl is held down, M is pressed and released, Ctrl is released)) is _not_ the same as `m^` (`M+Ctrl` (M is pressed and released, Ctrl is pressed and released)).

Spaces mean that all currently held modifier keys are released and that a new sequence is ready to be parsed. For example `^a ^a` would press `Ctrl+A` two times.
# Keyboard Input Guide

## Capabilities
We provide two distinct types of functionality, `Keyboard Shortcut`'s [macros] and `Key Press`'s [individual key press]

### Keyboard Shortcuts

- Sends One or Many keys to the OS like a macro.
- Cannot `hold` keys down
- Except in the case of Modifiers (alt, ctrl, etc.)

### Key Press

- Sends One and only One key to the OS.
- Extra Keys Will be Ignored
- Mirrors button state on controller
- If you hold down `a` on a controller the `key` will be held down
- If you release `a` on a controller the `key` will be released
- `Key Press System`
- This Action will ALWAYS be use-able while OVRAS is running
- `Key Press Misc.`
- This Action MAY not always be use-able depending on other Settings/Binds*
- Pending a future update.

## How To Set

- Go to the Settings File
- Windows: `%Appdata%\AdvancedSettings-Team` (`C:\Users\<username>\AppData\Roaming\AdvancedSettings-Team`)
- Linux: `~/.config/AdvancedSettings-Team/`
- open `OVR Advanced Settings.ini` with a text editor
- Go to `[keyboardShortcuts]`
- Add your sequence right after the `=` for the action you want.
- By Default Keyboard's are set to ctrl+shift+m `^>m`
- By Default Key Press's are set to F9 `F9`
- Example for ctrl+alt+delete for keyboardOne Action
- `keyboardOne=^*DEL`
- Example for Key Press System for a`
- `keyPressSystem=a`

## Supported Keys

### Modifier symbols

| Modifier | Symbol |
|---|---|
| Ctrl | `^` |
| Alt | `*` |
| Shift | `>` |
| Super (Windows) | `#` |

### Literal symbols

| Key | Symbol |
|---|---|
| A to Z | The letter in lowercase. `a`, `b`, `c`, ... |
| Number Row 0-9 | The number. `0`, `1`, `2`, ... |
| Function keys F1-F9 | Capital F followed by number. `F1`, `F2`, `F3`, ... |
| Backspace | `BACKSPACE` |
| Space | `SPACE` |
| Tab | `TAB` |
| Escape | `ESC` |
| Insert | `INS` |
| Delete | `DEL` |
| End | `END` |
| Page Down | `PGDN` |
| Page Up | `PGUP` |
| Caps Lock | `CAPS` |
| Print Screen | `PRNSCRN` |
| Pause/Break | `PAUSE` |
| Scroll Lock | `SCRLOCK` |
| Left Arrow | `LEFTARROW` |
| Right Arrow | `RIGHTARROW` |
| Up Arrow | `UPARROW` |
| Down Arrow | `DOWNARROW` |
| Keypad Slash | `KPSLASH` |
| Keypad Asterisk | `KPSTAR` |
| Keypad Minus | `KPMINUS` |
| Keypad Plus | `KPPLUS` |
| Enter | `ENTER` |


### Misc symbols
| Action | Symbol |
|---|---|
| Release Held Keys | ` ` (literal space or end of string) |


## Examples

### Keyboard Examples

| Sequence | String | Key Representation |
|---|---|---|
| Ctrl + H | `^h` | Ctrl+, h+, h-, Ctrl- |
| Ctrl + H + H | `^hh` | Ctrl+, h+, h-, h+, h-, Ctrl- |
| Ctrl + H twice | `^h ^h` | Ctrl+, h+, h-, Ctrl-, Ctrl+, h+, h-, Ctrl- |
| Ctrl + Alt + Delete | `^*DEL` | Ctrl+, Alt+, DEL+, DEL-, Ctrl-, Alt- |
| Alt + Enter | `*ENTER` | Alt+, ENTER+, ENTER-, Alt- |
| H + E + L + P | `help` | h+, h-, e+, e-, l+, l-, p+, p- |
| E + N + D | `end` | e+, e-, n+, n-, d+, d- |
| END Button | `END` | END+, END- |
| Alt + Shift + ENTER | `*>ENTER` | Alt+, Shift+, ENTER+, ENTER-, Alt-, Shift- |
| Alt + Tab + G + G + ENTER + Alt + Tab | `*TAB gg ENTER *TAB` | Alt+, Tab+, Tab-, Alt-, g+, g-, g+, g-, ENTER+, ENTER-, Alt+, Tab+, Tab-, Alt- |


### Key Press Examples

| Sequence | String | Key Rep On Press | Key Rep on Release
|---|---|---|---|
| Ctrl | `^` | Ctrl+ | Ctrl- |
| H | `h` | h+ | h- |
| Ctrl + H | `^h` | Ctrl+ | Ctrl- |


## Common Issues

### Case Sensative
- basic characters are all LOWER case, while keys such as ENTER are all UPPER case.

### 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"

### Multiple Key Events
- you must separate multiple events with a space (` `)
- 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]
Binary file added docs/screenshots/ChaperoneAdditionalPage.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 modified docs/screenshots/ChaperonePage.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 modified docs/screenshots/RootPage.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 modified docs/screenshots/RotationPage.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 modified docs/screenshots/SettingsPage.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 modified docs/screenshots/SteamVRPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions src/openvr/ivrinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ SteamIVRInput::SteamIVRInput()
m_keyboardOne( action_keys::keyboardOne ),
m_keyboardTwo( action_keys::keyboardTwo ),
m_keyboardThree( action_keys::keyboardThree ),
m_keyboardPressOne( action_keys::keyboardPressOne ),
m_keyboardPressTwo( action_keys::keyboardPressTwo ),
m_keyPressMisc( action_keys::keyPressMisc ),
m_keyPressSystem( action_keys::keyPressSystem ),
m_chaperoneToggle( action_keys::chaperoneToggle ),
m_pushToTalk( action_keys::pushToTalk ),
m_leftHaptic( action_keys::hapticsLeft ),
Expand Down Expand Up @@ -351,13 +351,13 @@ bool SteamIVRInput::keyboardThree()
{
return isDigitalActionActivatedOnce( m_keyboardThree );
}
bool SteamIVRInput::keyboardPressOne()
bool SteamIVRInput::keyPressMisc()
{
return isDigitalActionActivatedConstant( m_keyboardPressOne );
return isDigitalActionActivatedConstant( m_keyPressMisc );
}
bool SteamIVRInput::keyboardPressTwo()
bool SteamIVRInput::keyPressSystem()
{
return isDigitalActionActivatedConstant( m_keyboardPressTwo );
return isDigitalActionActivatedConstant( m_keyPressSystem );
}

/*!
Expand Down
12 changes: 6 additions & 6 deletions src/openvr/ivrinput.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ namespace action_keys
constexpr auto keyboardOne = "/actions/misc/in/KeyboardOne";
constexpr auto keyboardTwo = "/actions/misc/in/KeyboardTwo";
constexpr auto keyboardThree = "/actions/misc/in/KeyboardThree";
constexpr auto keyboardPressOne = "/actions/misc/in/KeyboardPressOne";
constexpr auto keyboardPressTwo = "/actions/misc/in/KeyboardPressTwo";
constexpr auto keyPressMisc = "/actions/misc/in/KeyPressMisc";
constexpr auto keyPressSystem = "/actions/system/in/KeyPressSystem";

constexpr auto hapticsLeft = "/actions/haptic/out/HapticsLeft";
constexpr auto hapticsRight = "/actions/haptic/out/HapticsRight";
Expand Down Expand Up @@ -160,8 +160,8 @@ class SteamIVRInput
bool keyboardOne();
bool keyboardTwo();
bool keyboardThree();
bool keyboardPressOne();
bool keyboardPressTwo();
bool keyPressMisc();
bool keyPressSystem();

vr::VRActionHandle_t leftHapticActionHandle();
vr::VRActionHandle_t rightHapticActionHandle();
Expand Down Expand Up @@ -229,8 +229,8 @@ class SteamIVRInput
DigitalAction m_keyboardOne;
DigitalAction m_keyboardTwo;
DigitalAction m_keyboardThree;
DigitalAction m_keyboardPressOne;
DigitalAction m_keyboardPressTwo;
DigitalAction m_keyPressMisc;
DigitalAction m_keyPressSystem;

// Misc Bindings
DigitalAction m_chaperoneToggle;
Expand Down
Loading

0 comments on commit 88a1c00

Please sign in to comment.