Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
c7b10630
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c7b10630
编写于
10月 23, 2022
作者:
M
Marvin Häuser
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcAppleEventLib: Support dwell-clicking
Fixes
https://github.com/acidanthera/bugtracker/issues/2067
上级
b6d62ed5
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
248 addition
and
55 deletion
+248
-55
Changelog.md
Changelog.md
+1
-0
Docs/Configuration.pdf
Docs/Configuration.pdf
+0
-0
Docs/Configuration.tex
Docs/Configuration.tex
+34
-0
Docs/Sample.plist
Docs/Sample.plist
+6
-0
Docs/SampleCustom.plist
Docs/SampleCustom.plist
+6
-0
Include/Acidanthera/Library/OcAppleEventLib.h
Include/Acidanthera/Library/OcAppleEventLib.h
+24
-18
Include/Acidanthera/Library/OcConfigurationLib.h
Include/Acidanthera/Library/OcConfigurationLib.h
+13
-10
Library/OcAppleEventLib/AppleEventInternal.h
Library/OcAppleEventLib/AppleEventInternal.h
+12
-0
Library/OcAppleEventLib/OcAppleEventLib.c
Library/OcAppleEventLib/OcAppleEventLib.c
+10
-1
Library/OcAppleEventLib/PointerHandler.c
Library/OcAppleEventLib/PointerHandler.c
+125
-15
Library/OcConfigurationLib/OcConfigurationLib.c
Library/OcConfigurationLib/OcConfigurationLib.c
+13
-10
Library/OcMainLib/OpenCoreUefi.c
Library/OcMainLib/OpenCoreUefi.c
+4
-1
未找到文件。
Changelog.md
浏览文件 @
c7b10630
...
...
@@ -4,6 +4,7 @@ OpenCore Changelog
-
Updated emulated NVRAM save script for compatibilty with earlier macOS (Snow Leopard+ tested)
-
Updated emulated NVRAM save script to automatically install as launch daemon (Yosemite+) or logout hook
-
Fixed maximum click duration and double click speed for non-standard poll frequencies
-
Added support for pointer dwell-clicking
#### v0.8.5
-
Updated builtin firmware versions for SMBIOS and the rest
...
...
Docs/Configuration.pdf
浏览文件 @
c7b10630
无法预览此类型文件
Docs/Configuration.tex
浏览文件 @
c7b10630
...
...
@@ -7604,6 +7604,40 @@ for additional options.
optionally be modified in combination with
\texttt
{
PointerSpeedDiv
}
, according to user
preference, to achieve customised mouse movement scaling.
\item
\texttt
{
PointerDwellClickTimeout
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
integer
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
0
}
\\
\textbf
{
Description
}
: Configure pointer dwell
-
clicking single left click timeout in
milliseconds in the OpenCore re
-
implementation of the Apple Event protocol.
Has no effect when using the OEM Apple implementation
(
see
\texttt
{
AppleEvent
}
setting
)
.
When the timeout expires, a single left click is issued at the current position.
\texttt
{
0
}
indicates the timeout is disabled.
\item
\texttt
{
PointerDwellDoubleClickTimeout
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
integer
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
0
}
\\
\textbf
{
Description
}
: Configure pointer dwell
-
clicking single left double click timeout in
milliseconds in the OpenCore re
-
implementation of the Apple Event protocol.
Has no effect when using the OEM Apple implementation
(
see
\texttt
{
AppleEvent
}
setting
)
.
When the timeout expires, a single left double click is issued at the current position.
\texttt
{
0
}
indicates the timeout is disabled.
\item
\texttt
{
PointerDwellRadius
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
integer
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
0
}
\\
\textbf
{
Description
}
: Configure pointer dwell
-
clicking tolerance radius in pixels in the
OpenCore re
-
implementation of the Apple Event protocol.
Has no effect when using the OEM Apple implementation
(
see
\texttt
{
AppleEvent
}
setting
)
.
The radius is scaled by
\texttt
{
UIScale
}
. When the pointer leaves this radius, the timeouts for
\texttt
{
PointerDwellClickTimeout
}
and
\texttt
{
PointerDwellDoubleClickTimeout
}
are reset and the new position is the centre
for the new dwell
-
clicking tolerance radius.
\end
{
enumerate
}
\subsection
{
Audio Properties
}
\label
{
uefiaudioprops
}
...
...
Docs/Sample.plist
浏览文件 @
c7b10630
...
...
@@ -1379,6 +1379,12 @@
<integer>
50
</integer>
<key>
KeySubsequentDelay
</key>
<integer>
5
</integer>
<key>
PointerDwellClickTimeout
</key>
<integer>
0
</integer>
<key>
PointerDwellDoubleClickTimeout
</key>
<integer>
0
</integer>
<key>
PointerDwellRadius
</key>
<integer>
0
</integer>
<key>
PointerPollMask
</key>
<integer>
-1
</integer>
<key>
PointerPollMax
</key>
...
...
Docs/SampleCustom.plist
浏览文件 @
c7b10630
...
...
@@ -1747,6 +1747,12 @@
<integer>
50
</integer>
<key>
KeySubsequentDelay
</key>
<integer>
5
</integer>
<key>
PointerDwellClickTimeout
</key>
<integer>
0
</integer>
<key>
PointerDwellDoubleClickTimeout
</key>
<integer>
0
</integer>
<key>
PointerDwellRadius
</key>
<integer>
0
</integer>
<key>
PointerPollMask
</key>
<integer>
-1
</integer>
<key>
PointerPollMax
</key>
...
...
Include/Acidanthera/Library/OcAppleEventLib.h
浏览文件 @
c7b10630
...
...
@@ -41,6 +41,9 @@
@param[in] PointerPollMask Pointer polling mask to choose polled handles.
@param[in] PointerSpeedDiv Pointer speed divisor. If zero, warn and use 1.
@param[in] PointerSpeedMul Pointer speed multiplier.
@param[in] PointerDwellClickTimeout Pointer dwell-clicking single left click timeout.
@param[in] PointerDwellDoubleClickTimeout Pointer dwell-clicking single left double click timeout.
@param[in] PointerDwellRadius Pointer dwell-clicking tolerance radius in pixels.
@retval installed or located protocol or NULL.
**/
...
...
@@ -56,7 +59,10 @@ OcAppleEventInstallProtocol (
IN
UINT32
PointerPollMax
,
IN
UINT32
PointerPollMask
,
IN
UINT16
PointerSpeedDiv
,
IN
UINT16
PointerSpeedMul
IN
UINT16
PointerSpeedMul
,
IN
UINT16
PointerDwellClickTimeout
,
IN
UINT16
PointerDwellDoubleClickTimeout
,
IN
UINT16
PointerDwellRadius
);
#endif // OC_APPLE_EVENT_LIB_H
Include/Acidanthera/Library/OcConfigurationLib.h
浏览文件 @
c7b10630
...
...
@@ -637,12 +637,15 @@ OC_DECLARE (OC_UEFI_APFS)
_(BOOLEAN , CustomDelays , , FALSE , ()) \
_(UINT16 , KeyInitialDelay , , 50 , ()) \
_(UINT16 , KeySubsequentDelay , , 5 , ()) \
_(BOOLEAN , GraphicsInputMirroring, , FALSE , ()) \
_(BOOLEAN , GraphicsInputMirroring
, , FALSE , ()) \
_(UINT32 , PointerPollMin , , 0 , ()) \
_(UINT32 , PointerPollMax , , 0 , ()) \
_(UINT32 , PointerPollMask , , ((UINT32) (-1)) , ()) \
_(UINT16 , PointerSpeedDiv , , 1 , ()) \
_(UINT16 , PointerSpeedMul , , 1 , ())
_(UINT16 , PointerSpeedMul , , 1 , ()) \
_(UINT16 , PointerDwellClickTimeout , , 0 , ()) \
_(UINT16 , PointerDwellDoubleClickTimeout, , 0 , ()) \
_(UINT16 , PointerDwellRadius , , 0 , ())
OC_DECLARE
(
OC_UEFI_APPLEINPUT
)
///
...
...
Library/OcAppleEventLib/AppleEventInternal.h
浏览文件 @
c7b10630
...
...
@@ -164,6 +164,11 @@ InternalSetKeyBehaviour (
IN
BOOLEAN
GraphicsInputMirroring
);
VOID
InternalInitializePointerUiScale
(
VOID
);
VOID
InternalSetPointerPolling
(
IN
UINT32
PointerPollMin
,
...
...
@@ -177,6 +182,13 @@ InternalSetPointerSpeed (
IN
UINT16
PointerSpeedMul
);
VOID
InternalSetDwellClicking
(
IN
UINT16
ClickTimeout
,
IN
UINT16
DoubleClickTimeout
,
IN
UINT16
Radius
);
extern
UINT32
mPointerSpeedMul
;
extern
UINT32
mPointerSpeedDiv
;
...
...
Library/OcAppleEventLib/OcAppleEventLib.c
浏览文件 @
c7b10630
...
...
@@ -564,7 +564,10 @@ OcAppleEventInstallProtocol (
IN
UINT32
PointerPollMax
,
IN
UINT32
PointerPollMask
,
IN
UINT16
PointerSpeedDiv
,
IN
UINT16
PointerSpeedMul
IN
UINT16
PointerSpeedMul
,
IN
UINT16
PointerDwellClickTimeout
,
IN
UINT16
PointerDwellDoubleClickTimeout
,
IN
UINT16
PointerDwellRadius
)
{
EFI_STATUS
Status
;
...
...
@@ -618,8 +621,14 @@ OcAppleEventInstallProtocol (
GraphicsInputMirroring
);
InternalInitializePointerUiScale
();
InternalSetPointerPolling
(
PointerPollMin
,
PointerPollMax
,
PointerPollMask
);
InternalSetPointerSpeed
(
PointerSpeedDiv
,
PointerSpeedMul
);
InternalSetDwellClicking
(
PointerDwellClickTimeout
,
PointerDwellDoubleClickTimeout
,
PointerDwellRadius
);
Status
=
gBS
->
InstallMultipleProtocolInterfaces
(
&
gImageHandle
,
...
...
Library/OcAppleEventLib/PointerHandler.c
浏览文件 @
c7b10630
...
...
@@ -144,6 +144,33 @@ STATIC UINT64 mMaxPointerResolutionY = 1;
STATIC
UINT64
mPointerRawX
;
STATIC
UINT64
mPointerRawY
;
STATIC
UINT32
mDwellClickTimeout
;
STATIC
UINT32
mDwellDoubleClickTimeout
;
STATIC
UINT32
mDwellClickRadiusSqr
;
STATIC
DIMENSION
mDwellPosition
;
STATIC
UINT32
mDwellClickTime
;
VOID
InternalInitializePointerUiScale
(
VOID
)
{
EFI_STATUS
Status
;
UINTN
DataSize
;
DataSize
=
sizeof
(
mUiScale
);
Status
=
gRT
->
GetVariable
(
APPLE_UI_SCALE_VARIABLE_NAME
,
&
gAppleVendorVariableGuid
,
NULL
,
&
DataSize
,
(
VOID
*
)
&
mUiScale
);
if
(
EFI_ERROR
(
Status
)
||
(
mUiScale
!=
2
))
{
mUiScale
=
1
;
}
}
VOID
InternalSetPointerPolling
(
IN
UINT32
PointerPollMin
,
...
...
@@ -193,6 +220,18 @@ InternalSetPointerSpeed (
mPointerSpeedMul
=
PointerSpeedMul
;
}
VOID
InternalSetDwellClicking
(
IN
UINT16
ClickTimeout
,
IN
UINT16
DoubleClickTimeout
,
IN
UINT16
Radius
)
{
mDwellClickTimeout
=
(
UINT32
)
ClickTimeout
*
10000
;
mDwellDoubleClickTimeout
=
(
UINT32
)
DoubleClickTimeout
*
10000
;
mDwellClickRadiusSqr
=
((
UINT32
)
Radius
*
Radius
)
*
(
mUiScale
*
mUiScale
);
}
// InternalRegisterSimplePointerInterface
STATIC
VOID
...
...
@@ -720,6 +759,90 @@ InternalHandleButtonInteraction (
++
Pointer
->
ButtonTicksSinceClick
;
}
STATIC
VOID
InternalResetDwellClicking
(
VOID
)
{
mDwellClickTime
=
0
;
CopyMem
(
&
mDwellPosition
,
&
mCursorPosition
,
sizeof
(
mDwellPosition
)
);
}
STATIC
VOID
InternalQueueDwellClick
(
IN
APPLE_EVENT_TYPE
EventType
,
IN
APPLE_MODIFIER_MAP
Modifiers
)
{
APPLE_EVENT_INFORMATION
*
Information
;
Information
=
InternalCreatePointerEventQueueInformation
(
APPLE_EVENT_TYPE_LEFT_BUTTON
|
APPLE_EVENT_TYPE_MOUSE_DOWN
,
Modifiers
);
if
(
Information
!=
NULL
)
{
EventAddEventToQueue
(
Information
);
}
Information
=
InternalCreatePointerEventQueueInformation
(
APPLE_EVENT_TYPE_LEFT_BUTTON
|
APPLE_EVENT_TYPE_MOUSE_UP
,
Modifiers
);
if
(
Information
!=
NULL
)
{
EventAddEventToQueue
(
Information
);
}
Information
=
InternalCreatePointerEventQueueInformation
(
APPLE_EVENT_TYPE_LEFT_BUTTON
|
EventType
,
Modifiers
);
if
(
Information
!=
NULL
)
{
EventAddEventToQueue
(
Information
);
}
}
STATIC
VOID
InternalHandleDwellClicking
(
IN
APPLE_MODIFIER_MAP
Modifiers
)
{
BOOLEAN
ClickDisabled
;
BOOLEAN
DoubleClickDisabled
;
INT32
DistX
;
INT32
DistY
;
ClickDisabled
=
mDwellClickTimeout
==
0
;
DoubleClickDisabled
=
mDwellDoubleClickTimeout
==
0
;
if
(
ClickDisabled
&&
DoubleClickDisabled
)
{
return
;
}
DistX
=
mCursorPosition
.
Horizontal
-
mDwellPosition
.
Horizontal
;
DistY
=
mCursorPosition
.
Vertical
-
mDwellPosition
.
Vertical
;
if
((
UINT32
)(
DistX
*
DistX
+
DistY
*
DistY
)
<=
mDwellClickRadiusSqr
)
{
mDwellClickTime
+=
mSimplePointerPollTime
;
if
(
!
DoubleClickDisabled
&&
(
mDwellClickTime
>=
mDwellDoubleClickTimeout
))
{
InternalQueueDwellClick
(
APPLE_EVENT_TYPE_MOUSE_DOUBLE_CLICK
,
Modifiers
);
InternalResetDwellClicking
();
}
else
if
(
!
ClickDisabled
&&
(
mDwellClickTime
>=
mDwellClickTimeout
))
{
InternalQueueDwellClick
(
APPLE_EVENT_TYPE_MOUSE_CLICK
,
Modifiers
);
if
(
DoubleClickDisabled
)
{
InternalResetDwellClicking
();
}
}
}
else
{
InternalResetDwellClicking
();
}
}
// InternalSimplePointerPollNotifyFunction
STATIC
VOID
...
...
@@ -879,6 +1002,8 @@ InternalSimplePointerPollNotifyFunction (
InternalHandleButtonInteraction
(
CommonStatus
,
&
mLeftButtonInfo
,
Modifiers
);
InternalHandleButtonInteraction
(
CommonStatus
,
&
mRightButtonInfo
,
Modifiers
);
InternalHandleDwellClicking
(
Modifiers
);
}
if
(
EFI_ERROR
(
CommonStatus
))
{
...
...
@@ -944,25 +1069,10 @@ EventCreateSimplePointerPollEvent (
)
{
EFI_STATUS
Status
;
UINTN
DataSize
;
UINTN
Index
;
DEBUG
((
DEBUG_VERBOSE
,
"EventCreateSimplePointerPollEvent
\n
"
));
DataSize
=
sizeof
(
mUiScale
);
Status
=
gRT
->
GetVariable
(
APPLE_UI_SCALE_VARIABLE_NAME
,
&
gAppleVendorVariableGuid
,
NULL
,
&
DataSize
,
(
VOID
*
)
&
mUiScale
);
if
(
EFI_ERROR
(
Status
)
||
(
mUiScale
!=
2
))
{
mUiScale
=
1
;
}
InternalRemoveUninstalledInstances
(
&
mPointerProtocols
,
&
mNumberOfPointerProtocols
,
...
...
Library/OcConfigurationLib/OcConfigurationLib.c
浏览文件 @
c7b10630
...
...
@@ -769,6 +769,9 @@ OC_SCHEMA
OC_SCHEMA_BOOLEAN_IN
(
"GraphicsInputMirroring"
,
OC_GLOBAL_CONFIG
,
Uefi
.
AppleInput
.
GraphicsInputMirroring
),
OC_SCHEMA_INTEGER_IN
(
"KeyInitialDelay"
,
OC_GLOBAL_CONFIG
,
Uefi
.
AppleInput
.
KeyInitialDelay
),
OC_SCHEMA_INTEGER_IN
(
"KeySubsequentDelay"
,
OC_GLOBAL_CONFIG
,
Uefi
.
AppleInput
.
KeySubsequentDelay
),
OC_SCHEMA_INTEGER_IN
(
"PointerDwellClickTimeout"
,
OC_GLOBAL_CONFIG
,
Uefi
.
AppleInput
.
PointerDwellClickTimeout
),
OC_SCHEMA_INTEGER_IN
(
"PointerDwellDoubleClickTimeout"
,
OC_GLOBAL_CONFIG
,
Uefi
.
AppleInput
.
PointerDwellDoubleClickTimeout
),
OC_SCHEMA_INTEGER_IN
(
"PointerDwellRadius"
,
OC_GLOBAL_CONFIG
,
Uefi
.
AppleInput
.
PointerDwellRadius
),
OC_SCHEMA_INTEGER_IN
(
"PointerPollMask"
,
OC_GLOBAL_CONFIG
,
Uefi
.
AppleInput
.
PointerPollMask
),
OC_SCHEMA_INTEGER_IN
(
"PointerPollMax"
,
OC_GLOBAL_CONFIG
,
Uefi
.
AppleInput
.
PointerPollMax
),
OC_SCHEMA_INTEGER_IN
(
"PointerPollMin"
,
OC_GLOBAL_CONFIG
,
Uefi
.
AppleInput
.
PointerPollMin
),
...
...
Library/OcMainLib/OpenCoreUefi.c
浏览文件 @
c7b10630
...
...
@@ -451,7 +451,10 @@ OcReinstallProtocols (
Config
->
Uefi
.
AppleInput
.
PointerPollMax
,
Config
->
Uefi
.
AppleInput
.
PointerPollMask
,
Config
->
Uefi
.
AppleInput
.
PointerSpeedDiv
,
Config
->
Uefi
.
AppleInput
.
PointerSpeedMul
Config
->
Uefi
.
AppleInput
.
PointerSpeedMul
,
Config
->
Uefi
.
AppleInput
.
PointerDwellClickTimeout
,
Config
->
Uefi
.
AppleInput
.
PointerDwellDoubleClickTimeout
,
Config
->
Uefi
.
AppleInput
.
PointerDwellRadius
)
==
NULL
)
&&
InstallAppleEvent
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录