Skip to content

Commit

Permalink
Minimize and horizontal peak
Browse files Browse the repository at this point in the history
Can now minimize window, and horizontal peak suppressor while blinking is implemented
  • Loading branch information
Neeqstock committed Jun 12, 2023
1 parent b2fe41c commit b5cb1a8
Show file tree
Hide file tree
Showing 28 changed files with 196 additions and 76 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file modified .vs/DJeyeMouseWrapper/v17/.suo
Binary file not shown.
1 change: 1 addition & 0 deletions .vs/Supercharger/DJeyeMouseWrapper/codemap.dat

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .vs/Supercharger/DJeyeMouseWrapper/global_history.dat

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .vs/Supercharger/NeeqDMIs/codemap.dat

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .vs/Supercharger/_/DTabsHistory.dat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<ArrayOfstring xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeye_Wrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\setups\defaultsetup.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeye_Wrapper.csproj|C:\Users\neequ\OneDrive\Documenti\GitHub\DJEye_EyeLayer_Windows\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeye_Wrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\behaviors\kbshortcuts.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeye_Wrapper.csproj|C:\Users\neequ\OneDrive\Documenti\GitHub\DJEye_EyeLayer_Windows\modules\rack.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeye_Wrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\modules\mappingmodule.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeye_Wrapper.csproj|C:\Users\neequ\OneDrive\Documenti\GitHub\DJEye_EyeLayer_Windows\modules\renderingmodule.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeye_Wrapper.csproj|C:\Users\neequ\OneDrive\Documenti\GitHub\DJEye_EyeLayer_Windows\settings\defaultsettings.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeye_Wrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\behaviors\bbmouseclicks.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeye_Wrapper.csproj|C:\Users\neequ\OneDrive\Documenti\GitHub\DJEye_EyeLayer_Windows\mainwindow.xaml.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeye_Wrapper.csproj|C:\Users\neequ\OneDrive\Documenti\GitHub\DJEye_EyeLayer_Windows\settings\djeyewrappersettings.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string></ArrayOfstring>
<ArrayOfstring xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeyeMouseWrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\setups\defaultsetup.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeyeMouseWrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\behaviors\kbshorcutsalt.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:1:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeyeMouseWrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\behaviors\kbshortcuts.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeyeMouseWrapper.csproj|C:\Users\neequ\OneDrive\Documenti\GitHub\DJEye_EyeLayer_Windows\behaviors\bbsuppresshorizontalpeak.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:1:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeyeMouseWrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\modules\mappingmodule.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeyeMouseWrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\modules\mappingmodule.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeyeMouseWrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\behaviors\bbsuppresshorizontalpeak.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeyeMouseWrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\behaviors\kbshortcuts.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeyeMouseWrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\behaviors\bbmouseclicks.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string><string>D:0:0:{32B8450B-A336-467D-B4A0-C22AF3BF79A1}|DJeyeMouseWrapper.csproj|c:\users\neequ\onedrive\documenti\github\djeye_eyelayer_windows\behaviors\ebsuppresshorizontalpeak.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}</string></ArrayOfstring>
49 changes: 49 additions & 0 deletions Behaviors/BBsuppressHorizontalPeak.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using DJeyeMouseWrapper.Modules;
using NeeqDMIs.Eyetracking.Tobii;
using System;

namespace DJeyeMouseWrapper.Behaviors
{
internal class BBsuppressHorizontalPeak : ATobiiBlinkBehavior
{
public BBsuppressHorizontalPeak()
{
DCThresh = 1;
LCThresh = 1;
RCThresh = 1;
DOThresh = 2;
LOThresh = 2;
ROThresh = 2;
}

public override void Event_doubleClose()
{
Rack.MappingModule.SuppressGaze = true;
}

public override void Event_doubleOpen()
{
Rack.MappingModule.SuppressGaze = false;
}

public override void Event_leftClose()
{
Rack.MappingModule.SuppressGaze = true;
}

public override void Event_leftOpen()
{
Rack.MappingModule.SuppressGaze = false;
}

public override void Event_rightClose()
{
Rack.MappingModule.SuppressGaze = true;
}

public override void Event_rightOpen()
{
Rack.MappingModule.SuppressGaze = false;
}
}
}
41 changes: 41 additions & 0 deletions Behaviors/KBshorcutsAlt.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using DJeyeMouseWrapper.Modules;
using NeeqDMIs.Keyboard;
using RawInputProcessor;

namespace BlankADMI.Behaviors
{
internal class KBshortcutsAlt : IKeyboardBehavior
{
const VKeyCodes keyEnable = VKeyCodes.E;
const VKeyCodes keyDisable = VKeyCodes.D;
const VKeyCodes keyAlt = VKeyCodes.LeftMenu;

private bool isModPressed = false;
public int ReceiveEvent(RawInputEventArgs e)
{
// ALT MOD
if (e.VirtualKey == (int)keyAlt)
{
if(e.KeyPressState == KeyPressState.Down)
{
isModPressed = true;
}
else if(e.KeyPressState == KeyPressState.Up)
{
isModPressed = false;
}
}

// ENABLE, DISABLE
if(e.VirtualKey == (int)keyEnable && e.KeyPressState == KeyPressState.Down && isModPressed)
{
Rack.MappingModule.Enabled = true;
}
if (e.VirtualKey == (int)keyDisable && e.KeyPressState == KeyPressState.Down && isModPressed)
{
Rack.MappingModule.Enabled = false;
}
return 0;
}
}
}
4 changes: 2 additions & 2 deletions Behaviors/KBshortcuts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ internal class KBshortcuts : IKeyboardBehavior
{
const VKeyCodes keyEnable = VKeyCodes.E;
const VKeyCodes keyDisable = VKeyCodes.D;
const VKeyCodes keyShow = VKeyCodes.S;
const VKeyCodes keyHide = VKeyCodes.H;
//const VKeyCodes keyShow = VKeyCodes.S;
//const VKeyCodes keyHide = VKeyCodes.H;
public int ReceiveEvent(RawInputEventArgs e)
{
if(e.VirtualKey == (int)keyEnable && e.KeyPressState == KeyPressState.Down)
Expand Down
2 changes: 2 additions & 0 deletions DJeyeMouseWrapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Behaviors\BBmouseClicks.cs" />
<Compile Include="Behaviors\BBsuppressHorizontalPeak.cs" />
<Compile Include="Behaviors\KBshorcutsAlt.cs" />
<Compile Include="Behaviors\KBshortcuts.cs" />
<Compile Include="Modules\MappingModule.cs" />
<Compile Include="Settings\DefaultSettings.cs" />
Expand Down
8 changes: 6 additions & 2 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="DJeye mouse wrapper" WindowStyle="SingleBorderWindow" ResizeMode="NoResize"
Title="DJeye mouse wrapper" WindowStyle="SingleBorderWindow" ResizeMode="CanMinimize"
WindowStartupLocation="CenterScreen" WindowState="Normal" Width="384" Height="433" Loaded="Window_Loaded" Closing="Window_Closing">
<Grid Background="Black">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="299*"/>
<ColumnDefinition Width="85*"/>
</Grid.ColumnDefinitions>
<Grid Grid.ColumnSpan="2">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="1*" />
Expand Down
27 changes: 24 additions & 3 deletions Modules/MappingModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace DJeyeMouseWrapper
/// </summary>
public class MappingModule
{
public bool suppressGaze = false;
private readonly int SCROLLING_SPEED = 120;
private bool enabled = false;

Expand All @@ -24,6 +25,27 @@ public bool Enabled
}

public bool IsHoldScroll { get; private set; } = false;

public bool SuppressGaze
{
get { return suppressGaze; }
set
{
if (value != suppressGaze && !IsHoldScroll && Enabled) // Switch false -> true
{
suppressGaze = value;
if (suppressGaze)
{
Rack.TobiiModule.MouseEmulator.Enabled = false;
}
else
{
Rack.TobiiModule.MouseEmulator.Enabled = true;
}
}
}
}

private double HoldScrollY { get; set; }

private MicroTimer TimerScroll { get; set; }
Expand Down Expand Up @@ -78,15 +100,14 @@ internal void ReceiveHoldScroll_Start()
private void TimerScroll_MicroTimerElapsed(object sender, MicroTimerEventArgs e)
{
double verticalOffset = Rack.TobiiModule.LastEyePositionData.LeftEye.Y - HoldScrollY;
if(verticalOffset > Rack.UserSettings.DeadzoneSize)
if (verticalOffset > Rack.UserSettings.DeadzoneSize)
{
Rack.MouseModule.SendMouseWheelMove(SCROLLING_SPEED);
}
else if(verticalOffset < -Rack.UserSettings.DeadzoneSize)
else if (verticalOffset < -Rack.UserSettings.DeadzoneSize)
{
Rack.MouseModule.SendMouseWheelMove(-SCROLLING_SPEED);
}

}
}
}
1 change: 1 addition & 0 deletions Setups/DefaultSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void Setup()

// Behaviors spawn
Rack.TobiiModule.BlinkBehaviors.Add(Rack.BBmouseClicks);
Rack.TobiiModule.BlinkBehaviors.Add(new BBsuppressHorizontalPeak());
Rack.KeyboardModule.KeyboardBehaviors.Add(new KBshortcuts());

// Add disposables to list
Expand Down
Binary file modified bin/Release/DJeyeMouseWrapper.exe
Binary file not shown.
Binary file modified bin/Release/DJeyeMouseWrapper.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
55232715d42ae51013b61fc16526309ced493473
7fed4626f3b01e1f0c9f0c88a9a48e0a3c82c419
Binary file modified obj/Release/DJeyeMouseWrapper.exe
Binary file not shown.
Binary file modified obj/Release/DJeyeMouseWrapper.g.resources
Binary file not shown.
Binary file modified obj/Release/DJeyeMouseWrapper.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion obj/Release/DJeyeMouseWrapper_MarkupCompile.cache
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ TRACE
C:\Users\neequ\OneDrive\Documenti\GitHub\DJEye_EyeLayer_Windows\App.xaml
1219584333
11-1163821235
14945034738
16218701903
1391525045984
MainWindow.xaml;

Expand Down
2 changes: 1 addition & 1 deletion obj/Release/DJeyeMouseWrapper_MarkupCompile.i.cache
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ TRACE
C:\Users\neequ\OneDrive\Documenti\GitHub\DJEye_EyeLayer_Windows\App.xaml
1219584333
11-1163821235
15382892155
17-343440680
1391525045984
MainWindow.xaml;

Expand Down
Binary file modified obj/Release/MainWindow.baml
Binary file not shown.
Loading

0 comments on commit b5cb1a8

Please sign in to comment.