-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
127 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
Source/Core Providers/Core_Interception/Helpers/KeyNameHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Core_Interception.Helpers | ||
{ | ||
public static class KeyNameHelper | ||
{ | ||
[DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)] | ||
private static extern int GetKeyNameTextW(uint lParam, StringBuilder lpString, int nSize); | ||
|
||
// GetKeyNameTextW does not seem to return names for these ScanCodes | ||
private static readonly Dictionary<int, string> MissingKeyNames = new Dictionary<int, string> | ||
{ | ||
{ 100, "F13" }, { 101, "F14" }, { 102, "F15" }, { 103, "F16" }, { 104, "F17" }, { 105, "F18" }, | ||
{ 106, "F19" }, { 107, "F20" }, { 108, "F21" }, { 109, "F22" }, { 110, "F23" }, { 111, "F24" } | ||
}; | ||
|
||
public static string GetNameFromScanCode(int code) | ||
{ | ||
if (MissingKeyNames.ContainsKey(code)) | ||
{ | ||
return MissingKeyNames[code]; | ||
} | ||
uint lParam; | ||
if (code > 255) | ||
{ | ||
code -= 256; | ||
lParam = (0x100 | ((uint)code & 0xff)) << 16; | ||
} | ||
else | ||
{ | ||
lParam = (uint)(code) << 16; | ||
} | ||
|
||
var sb = new StringBuilder(260); | ||
if (GetKeyNameTextW(lParam, sb, 260) == 0) | ||
{ | ||
return null; | ||
} | ||
var keyName = sb.ToString().Trim(); | ||
if (keyName == "") return null; | ||
return keyName; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
Adds support for the [Tobii Eye Tracker](https://tobiigaming.com/) | ||
Eye position and head tracking data | ||
Eye position and head tracking data | ||
|
||
Requires the [Visual C++ Redistributable for Visual Studio 2012](https://www.microsoft.com/en-us/download/details.aspx?id=30679) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters