Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

window focus hotkey #2

Merged
merged 5 commits into from
Sep 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<CheckBox x:Name="CkbxOverflow" Content="Continuous writing" HorizontalAlignment="Left" Margin="226,208,0,0" VerticalAlignment="Top" VerticalContentAlignment="Center" Foreground="White" FontSize="15" FontFamily="Courier New" HorizontalContentAlignment="Left" Height="25" Width="186" Checked="CheckBox_Checked" Unchecked="CheckBox_Checked"/>
<Label x:Name="LblStatus" Content="Sending to" Foreground="#777777" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" HorizontalAlignment="Left" Margin="3,-2,0,0" VerticalAlignment="Top" Height="28" FontSize="10" Width="632"/>
<CheckBox x:Name="alwaysontop_toggle" Content="Always On Top" HorizontalAlignment="Left" Margin="480,0,0,0" VerticalAlignment="Top" VerticalContentAlignment="Center" Foreground="White" FontSize="15" FontFamily="Courier New" HorizontalContentAlignment="Right" Height="24" Width="142" Checked="CheckBox_Checked" Unchecked="CheckBox_Checked"/>
<Label Content="Press Alt-A To Focus on this APP" Foreground="#FFFFFF" FontSize="14" HorizontalAlignment="Left" Margin="205,-4,0,0" VerticalAlignment="Top" Height="34" Width="217"/>
</Grid>
</Window>

Expand Down
12 changes: 12 additions & 0 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using IniParser;
using IniParser.Model;
using Valve.VR;
using NHotkey.Wpf; // hotkey window focusing feature. thanks to 753 ( https://753.network/ ) for sharing this trick :)
//this needs a library called: "NHotkey.Wpf". if you using Microsoft Visual Studio 2022, you can add it to your project from the NuGet Package Manager.

namespace VRCTextboxOSC
{
Expand All @@ -30,6 +32,8 @@ public MainWindow()
OpenVR.Init(ref err, EVRApplicationType.VRApplication_Utility);
OpenVR.Applications.AddApplicationManifest("app.vrmanifest", false);
isEnabled = true;

HotkeyManager.Current.AddOrReplace("FocusHotkey", Key.A, ModifierKeys.Alt, FocusHotkey); // hotkey window focusing feature.

iniParser = new();
iniData = iniParser.ReadFile(CONFIGPATH);
Expand All @@ -50,6 +54,14 @@ public MainWindow()
}

private void Window_Closed(object s, EventArgs e) => iniParser.WriteFile(CONFIGPATH, iniData);

// hotkey window focusing feature.
// Make Windows focus on this application when a hotkey is pressed
private void FocusHotkey(object sender, EventArgs e)
{
Activate();
Focus();
}

private void CheckBox_Checked(object sender, RoutedEventArgs e) => SettingsChanged();

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ I has two modes:
- Manually send by pressing enter or the send button.

NEW:
- Added Window focus feature, press Alt+A to focus your keyboard and mouse from VRChat to VRCTextboxOSC
- Added "Set Window Always on top" mode,
This is useful for _Desktop Users_ who want to keep the textbox app window ontop of all other apps.

![always on top mode](https://user-images.githubusercontent.com/40323669/192068312-19d3b1f2-895a-4ed5-b1e5-a0627c1c7520.png)
![newfeatureupdated](https://user-images.githubusercontent.com/40323669/192115676-d9f59c3e-021d-4307-8157-3326d3d1a048.png)

# [Download here](https://github.com/I5UCC/VRCTextboxOSC/releases/download/v0.1.1/VRCTextboxOSCv0.1.1.zip)
# Download here
# [VRCTextboxOSC v0.1.1 beta (NEWEST)](https://github.com/I5UCC/VRCTextboxOSC/files/9639468/VRCTextboxOSCv0.1.1beta.zip)
# [VRCTextboxOSC v0.1.1 stable](https://github.com/I5UCC/VRCTextboxOSC/releases/download/v0.1.1/VRCTextboxOSCv0.1.1.zip)

# Showcase

Expand All @@ -32,3 +35,4 @@ Then just run the ```VRCTextboxOSC.exe``` and you are all set! <br/>

- [.NET 6 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0/runtime)


Binary file added VRCTextboxOSC.ico
Binary file not shown.