Skip to content

Commit

Permalink
Add Open Source Info window
Browse files Browse the repository at this point in the history
  • Loading branch information
Spengy committed Mar 8, 2020
1 parent 9dc77a7 commit 0968687
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 4 deletions.
3 changes: 2 additions & 1 deletion App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MouseToJoystick2"
StartupUri="MainWindow.xaml">
StartupUri="MainWindow.xaml"
ShutdownMode="OnMainWindowClose">
<Application.Resources>
<local:MainWindowModel x:Key="MainWindowModel" />
</Application.Resources>
Expand Down
1 change: 1 addition & 0 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
<TextBox Width="32" Height="20" IsEnabled="{Binding ManualScreenSize}" Text="{Binding ScreenHeight}"/>
</WrapPanel>
<ToggleButton Content="Run" Click="ToggleButton_Click" IsChecked="{Binding ShouldRun}" Margin="10"></ToggleButton>
<TextBlock HorizontalAlignment="Right"><Hyperlink FontSize="10" Click="Hyperlink_Click">Open Source Info</Hyperlink></TextBlock>
</StackPanel>
</Window>
5 changes: 5 additions & 0 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,10 @@ private void ToggleButton_Click(object sender, RoutedEventArgs e)
model.SettingsEnabled = true;
}
}

private void Hyperlink_Click(object sender, RoutedEventArgs e)
{
new OSSInfoWindow().Show();
}
}
}
7 changes: 7 additions & 0 deletions MouseToJoystick2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,17 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="OSSInfoWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="MainWindowModel.cs" />
<Compile Include="MouseToJoystickHandler.cs" />
<Compile Include="OSSInfoWindow.xaml.cs">
<DependentUpon>OSSInfoWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
Expand Down
6 changes: 3 additions & 3 deletions MouseToJoystickHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class MouseToJoystickHandler : IDisposable
private vJoy joystick = null;
private readonly uint id;

private long AXIS_MAX;
private long AXIS_MIN;
private long AXIS_MID;
private readonly long AXIS_MAX;
private readonly long AXIS_MIN;
private readonly long AXIS_MID;

private const uint VJOY_BTN_1 = 1;
private const uint VJOY_BTN_2 = 2;
Expand Down
64 changes: 64 additions & 0 deletions OSSInfoWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<Window x:Class="MouseToJoystick2.OSSInfoWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MouseToJoystick2"
mc:Ignorable="d"
Title="Open Source Info" SizeToContent="Width">
<TextBox TextWrapping="Wrap" xml:space="preserve" VerticalScrollBarVisibility="Visible" ScrollViewer.CanContentScroll="True" IsReadOnly="True">
This project uses code from open source projects.

# MouseKeyHook
Copyright (c) 2004-2015, George Mamaladze
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of asssdwd nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# vJoy
MIT License

Copyright (c) 2017 Shaul Eizikovich

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</TextBox>
</Window>
27 changes: 27 additions & 0 deletions OSSInfoWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace MouseToJoystick2
{
/// <summary>
/// Interaction logic for OSSInfoWindow.xaml
/// </summary>
public partial class OSSInfoWindow : Window
{
public OSSInfoWindow()
{
InitializeComponent();
}
}
}

0 comments on commit 0968687

Please sign in to comment.