Skip to content

Commit

Permalink
version 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PandaTeemo committed May 3, 2017
1 parent fda6bcd commit 704913a
Show file tree
Hide file tree
Showing 62 changed files with 631 additions and 530 deletions.
Binary file modified bin/Cursors/Default/0.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/1.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/10.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/11.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/12.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/13.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/14.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/15.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/16.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/17.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/18.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/19.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/2.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/20.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/21.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/22.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/23.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/24.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/25.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/26.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/27.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/28.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/29.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/3.cur
Binary file not shown.
Binary file added bin/Cursors/Default/30.cur
Binary file not shown.
Binary file added bin/Cursors/Default/31.cur
Binary file not shown.
Binary file added bin/Cursors/Default/32.cur
Binary file not shown.
Binary file added bin/Cursors/Default/33.cur
Binary file not shown.
Binary file added bin/Cursors/Default/34.cur
Binary file not shown.
Binary file added bin/Cursors/Default/35.cur
Binary file not shown.
Binary file added bin/Cursors/Default/36.cur
Binary file not shown.
Binary file added bin/Cursors/Default/37.cur
Binary file not shown.
Binary file added bin/Cursors/Default/38.cur
Binary file not shown.
Binary file added bin/Cursors/Default/39.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/4.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/5.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/6.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/7.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/8.cur
Binary file not shown.
Binary file modified bin/Cursors/Default/9.cur
Binary file not shown.
5 changes: 3 additions & 2 deletions build/Core/Core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<ClInclude Include="..\..\source\Core\Container\Array.hpp" />
<ClInclude Include="..\..\source\Core\Container\String.hpp" />
<ClInclude Include="..\..\source\Core\Root.hpp" />
<ClInclude Include="..\..\source\Core\Support\Debug.hpp" />
<ClInclude Include="..\..\source\Core\Support\Enum.hpp" />
<ClInclude Include="..\..\source\Core\Support\Settings.hpp" />
<ClInclude Include="..\..\source\Core\Support\Singleton.hpp" />
Expand All @@ -37,7 +36,6 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\source\Core\Root.cpp" />
<ClCompile Include="..\..\source\Core\Support\Debug.cpp" />
<ClCompile Include="..\..\source\Core\Support\Settings.cpp" />
<ClCompile Include="..\..\source\Core\Support\Tools.cpp" />
<ClCompile Include="..\..\source\Core\Windows\InputMonitor.cpp" />
Expand Down Expand Up @@ -110,6 +108,9 @@
<Link>
<SubSystem>Windows</SubSystem>
</Link>
<Lib>
<AdditionalDependencies>Wtsapi32.lib</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand Down
6 changes: 0 additions & 6 deletions build/Core/Core.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
<ClInclude Include="..\..\source\Core\Container\String.hpp">
<Filter>Container</Filter>
</ClInclude>
<ClInclude Include="..\..\source\Core\Support\Debug.hpp">
<Filter>Support</Filter>
</ClInclude>
<ClInclude Include="..\..\source\Core\Support\Enum.hpp">
<Filter>Support</Filter>
</ClInclude>
Expand Down Expand Up @@ -53,9 +50,6 @@
<ClInclude Include="..\..\source\Core\Types.hpp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\source\Core\Support\Debug.cpp">
<Filter>Support</Filter>
</ClCompile>
<ClCompile Include="..\..\source\Core\Support\Settings.cpp">
<Filter>Support</Filter>
</ClCompile>
Expand Down
33 changes: 32 additions & 1 deletion build/Installer32/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="YoloMouse" Language="1033" Version="0.8.3.0" Manufacturer="HaPpY" UpgradeCode="69ce184e-a676-4169-a124-e1ee073bd0e6">
<Product Id="*" Name="YoloMouse" Language="1033" Version="0.9.0.0" Manufacturer="HaPpY" UpgradeCode="69ce184e-a676-4169-a124-e1ee073bd0e6">

<Package Id="*" InstallerVersion="200" Compressed="yes" InstallPrivileges="elevated" InstallScope="perMachine" />
<WixVariable Id="WixUILicenseRtf" Value="$(var.SolutionDir)\..\etc\Eula.rtf" />
Expand Down Expand Up @@ -132,6 +132,37 @@
<File Id="DefaultCursor29" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\29.cur" KeyPath="yes" />
</Component>

<Component Id="DefaultCursor30" Guid="{1A979B48-B2E9-4D94-8B13-CE395AA66659}">
<File Id="DefaultCursor30" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\30.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor31" Guid="{2FB5FCB0-0BA7-4E54-9268-446023799285}">
<File Id="DefaultCursor31" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\31.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor32" Guid="{CE2A784F-502C-4432-BAA8-83A43AFBE11F}">
<File Id="DefaultCursor32" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\32.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor33" Guid="{F96313B3-60EE-48DF-8BB2-A2B3CC9AAE90}">
<File Id="DefaultCursor33" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\33.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor34" Guid="{0C18A3DA-719B-4565-9182-D252F741A087}">
<File Id="DefaultCursor34" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\34.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor35" Guid="{22CAACDB-F7A1-4805-B803-847912F4F1CB}">
<File Id="DefaultCursor35" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\35.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor36" Guid="{595DF46A-154A-49EC-A9C7-29BB53C3756C}">
<File Id="DefaultCursor36" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\36.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor37" Guid="{FFDD97A2-DA3B-4D2B-86E1-0ADF2CD23144}">
<File Id="DefaultCursor37" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\37.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor38" Guid="{E955F2FB-11CC-4C31-B421-ED100ADF2776}">
<File Id="DefaultCursor38" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\38.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor39" Guid="{AEEE2D23-B015-4AF6-AFF8-FDA43B06DE17}">
<File Id="DefaultCursor39" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\39.cur" KeyPath="yes" />
</Component>

<Component Id="DefaultCursor80" Guid="{B6693082-6BFF-48B9-8E30-D9864E09E70B}">
<File Id="DefaultCursor80" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\80.ani" KeyPath="yes" />
</Component>
Expand Down
33 changes: 32 additions & 1 deletion build/Installer64/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="YoloMouse" Language="1033" Version="0.8.3.0" Manufacturer="HaPpY" UpgradeCode="69ce184e-a676-4169-a124-e1ee073bd0e6">
<Product Id="*" Name="YoloMouse" Language="1033" Version="0.9.0.0" Manufacturer="HaPpY" UpgradeCode="69ce184e-a676-4169-a124-e1ee073bd0e6">

<Package Id="*" InstallerVersion="200" Compressed="yes" InstallPrivileges="elevated" InstallScope="perMachine" Platform="x64"/>
<WixVariable Id="WixUILicenseRtf" Value="$(var.SolutionDir)\..\etc\Eula.rtf" />
Expand Down Expand Up @@ -135,6 +135,37 @@
<File Id="DefaultCursor29" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\29.cur" KeyPath="yes" />
</Component>

<Component Id="DefaultCursor30" Guid="{1A979B48-B2E9-4D94-8B13-CE395AA66659}" Win64="yes">
<File Id="DefaultCursor30" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\30.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor31" Guid="{2FB5FCB0-0BA7-4E54-9268-446023799285}" Win64="yes">
<File Id="DefaultCursor31" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\31.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor32" Guid="{CE2A784F-502C-4432-BAA8-83A43AFBE11F}" Win64="yes">
<File Id="DefaultCursor32" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\32.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor33" Guid="{F96313B3-60EE-48DF-8BB2-A2B3CC9AAE90}" Win64="yes">
<File Id="DefaultCursor33" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\33.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor34" Guid="{0C18A3DA-719B-4565-9182-D252F741A087}" Win64="yes">
<File Id="DefaultCursor34" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\34.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor35" Guid="{22CAACDB-F7A1-4805-B803-847912F4F1CB}" Win64="yes">
<File Id="DefaultCursor35" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\35.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor36" Guid="{595DF46A-154A-49EC-A9C7-29BB53C3756C}" Win64="yes">
<File Id="DefaultCursor36" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\36.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor37" Guid="{FFDD97A2-DA3B-4D2B-86E1-0ADF2CD23144}" Win64="yes">
<File Id="DefaultCursor37" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\37.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor38" Guid="{E955F2FB-11CC-4C31-B421-ED100ADF2776}" Win64="yes">
<File Id="DefaultCursor38" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\38.cur" KeyPath="yes" />
</Component>
<Component Id="DefaultCursor39" Guid="{AEEE2D23-B015-4AF6-AFF8-FDA43B06DE17}" Win64="yes">
<File Id="DefaultCursor39" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\39.cur" KeyPath="yes" />
</Component>

<Component Id="DefaultCursor80" Guid="{B6693082-6BFF-48B9-8E30-D9864E09E70B}" Win64="yes">
<File Id="DefaultCursor80" Source="$(var.YoloMouse.Loader.TargetDir)\Cursors\Default\80.ani" KeyPath="yes" />
</Component>
Expand Down
24 changes: 23 additions & 1 deletion source/Core/Root.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once
#include <Core/Root.hpp>
#include <Core/Support/Debug.hpp>
#include <Core/Support/Tools.hpp>
#include <stdio.h>

Expand Down Expand Up @@ -35,6 +34,29 @@ namespace Core
abort();
}

void LogConsole( const Char* format, ... )
{
static Bool open = false;
va_list vargs;

// only once
if(!open)
{
FILE* file;

AllocConsole();
freopen_s(&file, "conin$", "r", stdin);
freopen_s(&file, "conout$", "w", stdout);
freopen_s(&file, "conout$", "w", stderr);
open = true;
}

xassert(format != NULL);
va_start(vargs, format);
vfprintf(stdout, format, vargs); fputs("", stdout);
va_end(vargs);
}

//------------------------------------------------------------------------
void ExceptionMessage( const char* message, const char *file, unsigned line )
{
Expand Down
4 changes: 4 additions & 0 deletions source/Core/Root.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,8 @@ namespace Core
/**/
extern void LogFile( const Char* format, ... );
#define dlog LogFile

/**/
extern void LogConsole( const Char* format, ... );
#define clog LogConsole
}
32 changes: 0 additions & 32 deletions source/Core/Support/Debug.cpp

This file was deleted.

14 changes: 0 additions & 14 deletions source/Core/Support/Debug.hpp

This file was deleted.

60 changes: 37 additions & 23 deletions source/Core/Windows/InputMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ namespace Core
// public
//-------------------------------------------------------------------------
InputMonitor::InputMonitor( ShellUi& ui ):
_ui (ui),
_state (STATE_LIMIT),
_combo_time (0),
_combo_success (false)
_ui (ui),
_state (STATE_LIMIT),
_input_time (0),
_combo_pressed(false)
{
_state.Zero();
}
Expand All @@ -112,7 +112,7 @@ namespace Core
// create keyboard device
kb.usUsagePage = 0x01;
kb.usUsage = 0x06;
kb.dwFlags = RIDEV_NOLEGACY|RIDEV_INPUTSINK;
kb.dwFlags = RIDEV_NOLEGACY|RIDEV_INPUTSINK|RIDEV_APPKEYS|RIDEV_NOHOTKEYS;
kb.hwndTarget = _ui.GetHwnd();

// register keyboard device
Expand Down Expand Up @@ -203,26 +203,32 @@ namespace Core
//-------------------------------------------------------------------------
Bool InputMonitor::_OnInputKeyboard( const RAWKEYBOARD& kb )
{
ULong key = kb.VKey;
Bool down = ( kb.Flags & RI_KEY_BREAK ) == 0;
ULong key = kb.VKey;
Bool down = ( kb.Flags & RI_KEY_BREAK ) == 0;

// if valid
if( key < 0xff )
// if valid and changed
if( key < 0xff && _state[key] != down )
{
// get current uptime
// get current time
ULONGLONG current_time = GetTickCount64();

// if key is up and successful combo expired reset input state. this is a ghetto
// workaround to some windows hotkeys like CTRL ALT DEL not notifying rawinput.
if( _combo_success && !down && (current_time - _combo_time) > COMBO_EXPIRATION )

// if unbuffered
if( current_time > _input_time )
{
_state.Zero();
_combo_success = false;
}
// this is a ghetto workaround to some windows hotkeys like CTRL ALT DEL
// not notifying rawinput and therefore getting stuck in down state
if( down )
{
ULONGLONG dtime = current_time - _input_time;

// expire input state if over time limit
if( (_combo_pressed && dtime > COMBO_EXPIRATION) || (!_combo_pressed && dtime > NONCOMBO_EXPIRATION) )
_state.Zero();

// update input time
_input_time = current_time;
}

// if state changed
if( _state[key] != down )
{
// notify
_listener->OnKey(key, down);

Expand All @@ -236,11 +242,19 @@ namespace Core
// if combo notify
_listener->OnKeyCombo(combo->id);

// update combo time and success state
_combo_time = current_time;
_combo_success = true;
// update input time with buffer time to avoided unwanted queued up input
_input_time = GetTickCount64() + QUEUED_EXPIRATION;

// set combo pressed state
_combo_pressed = true;
}
// clear combo pressed state
else if( down )
_combo_pressed = false;
}
// else clear input state on up
else if( !down )
_state[key] = false;
}

return true;
Expand Down
16 changes: 9 additions & 7 deletions source/Core/Windows/InputMonitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ namespace Core
public ShellUi::IListener
{
public:
/**/
static const ULong STATE_LIMIT = 0xff;
static const ULong KEY_LIMIT = 4;
static const ULong COMBO_LIMIT = 50;
static const ULong COMBO_EXPIRATION = 3000;
// constants
static const ULong STATE_LIMIT = 0xff;
static const ULong KEY_LIMIT = 4;
static const ULong COMBO_LIMIT = 50;
static const ULong COMBO_EXPIRATION = 6000;
static const ULong NONCOMBO_EXPIRATION = 2000;
static const ULong QUEUED_EXPIRATION = 10;

/**/
struct IListener
Expand Down Expand Up @@ -67,7 +69,7 @@ namespace Core
ShellUi& _ui;
StateTable _state;
ComboCollection _combos;
ULONGLONG _combo_time;
Bool _combo_success;
ULONGLONG _input_time;
Bool _combo_pressed;
};
}
15 changes: 7 additions & 8 deletions source/Snoopy/Root.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once
#include <Core/Types.hpp>
#include <Core/Support/Debug.hpp>

namespace Snoopy
{
using namespace Core;
}
#pragma once
#include <Core/Types.hpp>

namespace Snoopy
{
using namespace Core;
}
Loading

0 comments on commit 704913a

Please sign in to comment.