Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change polarity of HID keyboard keys #1093

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public DisplayScreen(IPixelDisplay physicalDisplay, RotationType rotation = Rota

if (TouchScreen != null)
{
TouchScreen.TouchDown += _touchScreen_TouchDown;
TouchScreen.TouchUp += _touchScreen_TouchUp;
TouchScreen.TouchDown += OnTouchDown;
TouchScreen.TouchUp += OnTouchUp;
}

if (theme?.Font != null)
Expand Down Expand Up @@ -97,7 +97,7 @@ public Color BackgroundColor
}
}

private void _touchScreen_TouchUp(ITouchScreen source, TouchPoint point)
private void OnTouchUp(ITouchScreen source, TouchPoint point)
{
bool LookForUnclick(ControlsCollection controls)
{
Expand Down Expand Up @@ -128,7 +128,7 @@ bool LookForUnclick(ControlsCollection controls)
}
}

private void _touchScreen_TouchDown(ITouchScreen source, TouchPoint point)
private void OnTouchDown(ITouchScreen source, TouchPoint point)
{
bool LookForClick(ControlsCollection controls)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private void MacKeyScanner()
{
var state = InteropMac.CGEventSourceKeyState(
InteropMac.CGEventSourceStateID.hidSystemState,
keycode.Value) != 0;
keycode.Value) == 0;

key.Value.SetState(state);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ private void WindowsKeyScanner()
if ((state & 0x8000) != 0)
{
// key is currently down
key.Value.SetState(true);
key.Value.SetState(false);
}
else if ((state & 0x0001) != 0)
{
// state was down since last call (is now up)
key.Value.SetState(true);
key.Value.SetState(false);
key.Value.SetState(true);
}
else
{
key.Value.SetState(false);
key.Value.SetState(true);
}

}
Expand Down
Loading