mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Extended support for Z13 external keyboard
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using HidLibrary;
|
||||
using Microsoft.Win32;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
|
||||
namespace GHelper
|
||||
@@ -186,17 +185,22 @@ namespace GHelper
|
||||
private static HidDevice? GetInputDevice()
|
||||
{
|
||||
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
|
||||
HidDevice input = null;
|
||||
|
||||
foreach (HidDevice device in HidDeviceList)
|
||||
if (device.ReadFeatureData(out byte[] data, HID_ID))
|
||||
return device;
|
||||
return null;
|
||||
{
|
||||
input = device;
|
||||
Logger.WriteLine("Input Events" + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.Description + device.DevicePath);
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
public static bool TouchpadToggle()
|
||||
{
|
||||
HidDevice? input = GetInputDevice();
|
||||
if (input != null) return input.WriteFeatureData(new byte[] { HID_ID,0xf4,0x6b});
|
||||
if (input != null) return input.WriteFeatureData(new byte[] { HID_ID, 0xf4, 0x6b });
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -205,7 +209,7 @@ namespace GHelper
|
||||
HidDevice? input = GetInputDevice();
|
||||
if (input == null) return;
|
||||
|
||||
Logger.WriteLine("Input Events " + input.DevicePath);
|
||||
//Logger.WriteLine("Input Events " + input.DevicePath);
|
||||
|
||||
var task = Task.Run(() =>
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ using NAudio.CoreAudioApi;
|
||||
using System.Diagnostics;
|
||||
using System.Management;
|
||||
using Tools;
|
||||
using static NativeMethods;
|
||||
|
||||
namespace GHelper
|
||||
{
|
||||
@@ -212,15 +211,17 @@ namespace GHelper
|
||||
AsusUSB.ApplyBrightness(backlight);
|
||||
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, backlightNames[backlight], ToastIcon.BacklightUp);
|
||||
break;
|
||||
case 199: // ON Z13 - FN+F11 - cycles backlight
|
||||
if (++backlight > 3) backlight = 0;
|
||||
AppConfig.setConfig("keyboard_brightness", backlight);
|
||||
AsusUSB.ApplyBrightness(backlight);
|
||||
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, backlightNames[backlight], ToastIcon.BacklightUp);
|
||||
break;
|
||||
case 16: // FN+F7
|
||||
Program.acpi.DeviceSet(AsusACPI.UniversalControl, 0x10, "Brightness");
|
||||
//brightness = ScreenBrightness.Adjust(-10);
|
||||
//Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, brightness + "%", ToastIcon.BrightnessDown);
|
||||
break;
|
||||
case 32: // FN+F8
|
||||
Program.acpi.DeviceSet(AsusACPI.UniversalControl, 0x20, "Brightness");
|
||||
//brightness = ScreenBrightness.Adjust(+10);
|
||||
//Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, brightness + "%", ToastIcon.BrightnessUp);
|
||||
break;
|
||||
case 107: // FN+F10
|
||||
bool touchpadState = GetTouchpadState();
|
||||
|
||||
Reference in New Issue
Block a user