Skip to content

Commit

Permalink
endmee
Browse files Browse the repository at this point in the history
  • Loading branch information
mykesXD committed Jan 5, 2023
1 parent 10a2028 commit f18bd76
Show file tree
Hide file tree
Showing 62 changed files with 254 additions and 164 deletions.
Binary file modified .vs/KeyRemap/v16/.suo
Binary file not shown.
16 changes: 8 additions & 8 deletions KeyRemap/AddPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
<Rectangle xf:Animations.CombinedBinding="{Binding IsMouseOver, ElementName=Key1}"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource Expand}, Event=None}"
xf:Animations.Secondary="{xf:Animate BasedOn={StaticResource Contract}, Event=None}"
x:Name="Key1" RadiusX="10" RadiusY="10" Height="70" Width="70" Fill="#FF292C31" Canvas.Left="15" Canvas.Top="89" Stroke="#FF34373B" MouseLeftButtonDown="Key1_MouseLeftButtonDown" Cursor="Hand"/>
x:Name="Key1" RadiusX="10" RadiusY="10" Height="70" Width="74" Fill="#FF292C31" Canvas.Left="13" Canvas.Top="89" Stroke="#FF34373B" MouseLeftButtonDown="Key1_MouseLeftButtonDown" Cursor="Hand"/>
<Viewbox xf:Animations.CombinedBinding="{Binding IsMouseOver, ElementName=Key1}"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource Expand}, Event=None}"
xf:Animations.Secondary="{xf:Animate BasedOn={StaticResource Contract}, Event=None}"
Expand Down Expand Up @@ -228,11 +228,11 @@
<Rectangle xf:Animations.CombinedBinding="{Binding IsMouseOver, ElementName=Key2}"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource Expand}, Event=None}"
xf:Animations.Secondary="{xf:Animate BasedOn={StaticResource Contract}, Event=None}"
x:Name="Key2" RadiusX="10" RadiusY="10" Height="70" Width="70" Fill="#FF292C31" Canvas.Left="100" Canvas.Top="89" MouseLeftButtonDown="Key2_MouseLeftButtonDown" Stroke="#FF34373B" Cursor="Hand"/>
x:Name="Key2" RadiusX="10" RadiusY="10" Height="70" Width="74" Fill="#FF292C31" Canvas.Left="98" Canvas.Top="89" MouseLeftButtonDown="Key2_MouseLeftButtonDown" Stroke="#FF34373B" Cursor="Hand"/>
<Viewbox xf:Animations.CombinedBinding="{Binding IsMouseOver, ElementName=Key2}"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource Expand}, Event=None}"
xf:Animations.Secondary="{xf:Animate BasedOn={StaticResource Contract}, Event=None}"
Height="30" Canvas.Left="100" Canvas.Top="107" Width="71">
Height="30" Canvas.Left="100" Canvas.Top="107" Width="70">
<TextBlock FontFamily="{StaticResource SourceCodePro-Bold}" x:Name="Key2Text" IsHitTestVisible="False" TextWrapping="Wrap" Text=" " FontSize="18" Foreground="White" Canvas.Left="49" Canvas.Top="114"/>
</Viewbox>
<ListBox FontFamily="{StaticResource SourceCodePro-Regular}" FontSize="14" x:Name="Key2DropDown" Visibility="Hidden" BorderThickness="1,0,1,1" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Height="94" Canvas.Left="100" Canvas.Top="149" Width="70" BorderBrush="#FF34373B" Background="#FF292C31" Foreground="White" SelectionChanged="Key2DropDown_SelectionChanged">
Expand All @@ -253,7 +253,7 @@
<Viewbox xf:Animations.CombinedBinding="{Binding IsMouseOver, ElementName=Key3}"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource Expand}, Event=None}"
xf:Animations.Secondary="{xf:Animate BasedOn={StaticResource Contract}, Event=None}"
Height="30" Canvas.Left="192" Canvas.Top="107" Width="92">
Height="30" Canvas.Left="189" Canvas.Top="107" Width="92">
<TextBlock FontFamily="{StaticResource SourceCodePro-Bold}" x:Name="Key3Text" IsHitTestVisible="False" TextWrapping="Wrap" TextAlignment="Center" Text=" " HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" Foreground="White" Canvas.Left="241" Canvas.Top="110"/>
</Viewbox>
<ListBox FontFamily="{StaticResource SourceCodePro-Regular}" FontSize="14" Name="Key3DropDown" Visibility="Hidden" BorderThickness="1,0,1,1" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Height="229" Canvas.Left="185" Canvas.Top="149" Width="100" BorderBrush="#FF34373B" Background="#FF292C31" Foreground="White" SelectionChanged="Key3DropDown_SelectionChanged">
Expand All @@ -270,11 +270,11 @@
<Rectangle xf:Animations.CombinedBinding="{Binding IsMouseOver, ElementName=Key4}"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource Expand}, Event=None}"
xf:Animations.Secondary="{xf:Animate BasedOn={StaticResource Contract}, Event=None}"
x:Name="Key4" RadiusX="10" RadiusY="10" Height="70" Width="70" Fill="#FF292C31" Canvas.Left="372" Canvas.Top="89" MouseLeftButtonDown="Key4_MouseLeftButtonDown" Stroke="#FF34373B" Cursor="Hand"/>
x:Name="Key4" RadiusX="10" RadiusY="10" Height="70" Width="74" Fill="#FF292C31" Canvas.Left="372" Canvas.Top="89" MouseLeftButtonDown="Key4_MouseLeftButtonDown" Stroke="#FF34373B" Cursor="Hand"/>
<Viewbox xf:Animations.CombinedBinding="{Binding IsMouseOver, ElementName=Key4}"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource Expand}, Event=None}"
xf:Animations.Secondary="{xf:Animate BasedOn={StaticResource Contract}, Event=None}"
Height="30" Canvas.Left="372" Canvas.Top="107" Width="70">
Height="30" Canvas.Left="374" Canvas.Top="107" Width="70">
<TextBlock FontFamily="{StaticResource SourceCodePro-Bold}" x:Name="Key4Text" IsHitTestVisible="False" TextWrapping="Wrap" Text=" " FontSize="18" Foreground="White" Canvas.Left="49" Canvas.Top="114"/>
</Viewbox>
<ListBox FontFamily="{StaticResource SourceCodePro-Regular}" x:Name="Key4DropDown" Visibility="Hidden" BorderThickness="1,0,1,1" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Height="94" Canvas.Left="372" Canvas.Top="149" Width="70" BorderBrush="#FF34373B" Background="#FF292C31" Foreground="White" SelectionChanged="Key4DropDown_SelectionChanged">
Expand All @@ -291,11 +291,11 @@
<Rectangle xf:Animations.CombinedBinding="{Binding IsMouseOver, ElementName=Key5}"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource Expand}, Event=None}"
xf:Animations.Secondary="{xf:Animate BasedOn={StaticResource Contract}, Event=None}"
x:Name="Key5" RadiusX="10" RadiusY="10" Height="70" Width="70" Fill="#FF292C31" Canvas.Left="458" Canvas.Top="89" MouseLeftButtonDown="Key5_MouseLeftButtonDown" Stroke="#FF34373B" Cursor="Hand"/>
x:Name="Key5" RadiusX="10" RadiusY="10" Height="70" Width="74" Fill="#FF292C31" Canvas.Left="458" Canvas.Top="89" MouseLeftButtonDown="Key5_MouseLeftButtonDown" Stroke="#FF34373B" Cursor="Hand"/>
<Viewbox xf:Animations.CombinedBinding="{Binding IsMouseOver, ElementName=Key5}"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource Expand}, Event=None}"
xf:Animations.Secondary="{xf:Animate BasedOn={StaticResource Contract}, Event=None}"
Height="30" Canvas.Left="458" Canvas.Top="107" Width="70">
Height="30" Canvas.Left="460" Canvas.Top="107" Width="70">
<TextBlock FontFamily="{StaticResource SourceCodePro-Bold}" x:Name="Key5Text" IsHitTestVisible="False" TextWrapping="Wrap" Text=" " FontSize="18" Foreground="White" Canvas.Left="49" Canvas.Top="114"/>
</Viewbox>
<ListBox FontFamily="{StaticResource SourceCodePro-Regular}" FontSize="14" x:Name="Key5DropDown" Visibility="Hidden" BorderThickness="1,0,1,1" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Height="94" Canvas.Left="458" Canvas.Top="149" Width="70" BorderBrush="#FF34373B" Background="#FF292C31" Foreground="White" SelectionChanged="Key5DropDown_SelectionChanged">
Expand Down
9 changes: 6 additions & 3 deletions KeyRemap/AddPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,21 @@ public AddPage()
try
{
var p = Process.GetProcessById((int)procId).MainModule.FileVersionInfo.FileDescription;
if (p == "")
if (p == null && !processNameList.Contains(title))
{
processNameList.Add(title);
}
else
{
processNameList.Add(p);
if (!processNameList.Contains(p))
{
processNameList.Add(p);
}
}
using (System.Drawing.Icon ico = System.Drawing.Icon.ExtractAssociatedIcon(Process.GetProcessById((int)procId).MainModule.FileName))
{
processIcon.Add(ico.ToBitmap());
processIconList.Add(new ImageBrush(Imaging.CreateBitmapSourceFromHIcon(ico.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions())));
processIcon.Add(Util.BitmapFromSource(Imaging.CreateBitmapSourceFromHIcon(ico.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions())));
}
}
catch
Expand Down
1 change: 1 addition & 0 deletions KeyRemap/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ protected override void OnStartup(StartupEventArgs e)
}
private void Open(object sender, EventArgs e)
{
MainWindow.ShowInTaskbar = true;
MainWindow.Show();
MainWindow.WindowState = WindowState.Normal;
MainWindow.Activate();
Expand Down
4 changes: 2 additions & 2 deletions KeyRemap/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@
</Rectangle>
<Rectangle Name="BodyBackground" RadiusX="10" RadiusY="10" Height="409" VerticalAlignment="Top" Fill="#FF1E2126" Stroke="#FF292C31" Canvas.Left="20" Canvas.Top="113" Grid.ColumnSpan="3" Grid.RowSpan="3" Width="619" MouseLeftButtonDown="BodyBackground_MouseLeftButtonDown"/>
<Canvas Name="Handle" Height="39" Width="660" MouseLeftButtonDown="Handle_MouseLeftButtonDown" Background="Black" Opacity="0"/>
<ScrollViewer Name="ScrollView" Height="103" Canvas.Left="23" Canvas.Top="121" Width="629">
<Canvas Name ="ScrollContainer" Height="93">
<ScrollViewer Focusable="False" Name="ScrollView" Height="388" Canvas.Left="23" Canvas.Top="121" Width="629">
<Canvas Name ="ScrollContainer" Height="373" >
<Grid Name="BodyContainer" Height="87" Width="602" Canvas.Left="7" Canvas.Top="6">
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
Expand Down
13 changes: 4 additions & 9 deletions KeyRemap/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,15 @@ public MainPage()
try
{
var p = Process.GetProcessById((int)procId).MainModule.FileVersionInfo.FileDescription;
if (p == "")
if (p == null && !processNameList.Contains(title))
{
processNameList.Add(title);
}
else
{
processNameList.Add(p);
try
{
Console.WriteLine(Process.GetProcessById((int)procId).MainModule.FileName);
Console.WriteLine(p);
}
catch
if (!processNameList.Contains(p))
{
Console.WriteLine("{0},FAIL", p);
processNameList.Add(p);
}
}
using (System.Drawing.Icon ico = System.Drawing.Icon.ExtractAssociatedIcon(Process.GetProcessById((int)procId).MainModule.FileName))
Expand Down Expand Up @@ -230,6 +224,7 @@ private static string GetTitle(IntPtr handle, int length = 128)

public void CloseButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
MainWindow.mainWindowInstance.ShowInTaskbar = false;
MainWindow.mainWindowInstance.Hide();
MainWindow.mainWindowInstance.WindowState = WindowState.Minimized;
}
Expand Down
16 changes: 15 additions & 1 deletion KeyRemap/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
using System.Windows;
using System;
using System.Linq;
using System.Windows;
namespace KeyRemap
{
public partial class MainWindow : Window
{
public static MainWindow mainWindowInstance;
public string[] args;
public MainWindow()
{
InitializeComponent();
mainWindowInstance = this;
args = Environment.GetCommandLineArgs();
if (args.Count() > 1)
{
if (args[1] == "-startup")
{
this.Hide();
this.ShowInTaskbar = false;
WindowStyle = WindowStyle.None;
WindowState = WindowState.Minimized;
}
}
}
private void KeyRemapWindow_Loaded(object sender, RoutedEventArgs e)
{
Expand Down
6 changes: 2 additions & 4 deletions KeyRemap/Row.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,11 @@ public void Create()
MainPage.mainPageInstance.BodyContainer.Children.Add(keyLabel);
MainPage.mainPageInstance.BodyContainer.Children.Add(arrow);
MainPage.mainPageInstance.BodyContainer.Children.Add(keyLabel2);
if(MainPage.mainPageInstance.rows >= 1)
if(MainPage.mainPageInstance.rows >= 6)
{
MainPage.mainPageInstance.ScrollView.Height += 60;
MainPage.mainPageInstance.ScrollContainer.Height += 60;
//MainPage.mainPageInstance.BodyBackground.Height += 60;
MainPage.mainPageInstance.BodyContainer.Height += 60;
}
MainPage.mainPageInstance.BodyContainer.Height += 60;
MainPage.mainPageInstance.rows += 1;
}
}
Expand Down
2 changes: 1 addition & 1 deletion KeyRemap/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</Style.Triggers>
</Style>
</Page.Resources>
<Grid Name="SettingsContainer"
<Grid Name="SettingsContainer" Focusable="False"
XamlFlair:Animations.PrimaryBinding="{Binding BinderSettingsOpened, UpdateSourceTrigger=PropertyChanged}"
XamlFlair:Animations.Primary="{XamlFlair:Animate BasedOn={StaticResource FadeIn}, Duration=500, Event=None}">
<TextBlock FontFamily="{StaticResource SourceCodePro-Bold}" FontStyle="Normal" TextAlignment="Center" TextTrimming="CharacterEllipsis" x:Name="RunLabel" TextWrapping="Wrap" Text="RUN ON START-UP" FontSize="18" Foreground="White" FontWeight="Bold" Margin="94,99,454,383"/>
Expand Down
1 change: 1 addition & 0 deletions KeyRemap/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ private void ApplyButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress);
shortcut.Description = "Shortcut for MKeyRemap";
shortcut.IconLocation = Environment.CurrentDirectory + @"\MKeyRemap.exe, 0";
shortcut.Arguments = "-startup";
shortcut.TargetPath = Environment.CurrentDirectory + @"\MKeyRemap.exe";
shortcut.WorkingDirectory = Environment.CurrentDirectory;
shortcut.Save();
Expand Down
Binary file modified KeyRemap/bin/Debug/MKeyRemap.exe
Binary file not shown.
Binary file modified KeyRemap/bin/Debug/MKeyRemap.pdb
Binary file not shown.
Binary file modified KeyRemap/bin/Release/MKeyRemap.exe
Binary file not shown.
Binary file modified KeyRemap/bin/Release/MKeyRemap.pdb
Binary file not shown.
Binary file modified KeyRemap/obj/Debug/AddPage.baml
Binary file not shown.
Loading

0 comments on commit f18bd76

Please sign in to comment.