Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
6b8b363d
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,发现更多精彩内容 >>
提交
6b8b363d
编写于
4月 02, 2021
作者:
M
Marvin Häuser
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcAppleEventLib: Implement OcAppleEventEx protocol
上级
4f7f17cd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
50 addition
and
25 deletion
+50
-25
Library/OcAppleEventLib/AppleEventInternal.h
Library/OcAppleEventLib/AppleEventInternal.h
+3
-1
Library/OcAppleEventLib/OcAppleEventLib.c
Library/OcAppleEventLib/OcAppleEventLib.c
+42
-24
Library/OcAppleEventLib/OcAppleEventLib.inf
Library/OcAppleEventLib/OcAppleEventLib.inf
+1
-0
Library/OcAppleEventLib/PointerHandler.c
Library/OcAppleEventLib/PointerHandler.c
+4
-0
未找到文件。
Library/OcAppleEventLib/AppleEventInternal.h
浏览文件 @
6b8b363d
...
...
@@ -21,7 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <IndustryStandard/AppleHid.h>
#include <Protocol/
AppleEvent
.h>
#include <Protocol/
OcAppleEventEx
.h>
// EventCreateKeyStrokePollEvent
EFI_STATUS
...
...
@@ -161,4 +161,6 @@ InternalSetKeyDelays (
IN
UINT16
KeySubsequentDelay
);
extern
UINT32
mPointerScale
;
#endif // APPLE_EVENT_INTERNAL_H_
Library/OcAppleEventLib/OcAppleEventLib.c
浏览文件 @
6b8b363d
...
...
@@ -509,14 +509,33 @@ InternalUnregisterHandlers (
}
}
UINT32
EFIAPI
OcEventExSetPointerScale
(
IN
OUT
OC_APPLE_EVENT_EX_PROTOCOL
*
This
,
IN
UINT32
Scale
)
{
UINT32
OldScale
;
OldScale
=
mPointerScale
;
mPointerScale
=
Scale
;
return
OldScale
;
}
// mAppleEventProtocol
STATIC
APPLE_EVENT_PROTOCOL
mAppleEventProtocol
=
{
APPLE_EVENT_PROTOCOL_REVISION
,
EventRegisterHandler
,
EventUnregisterHandler
,
EventSetCursorPosition
,
EventSetEventName
,
EventIsCapsLockOn
STATIC
OC_APPLE_EVENT_EX_PROTOCOL
mAppleEventProtocol
=
{
OC_APPLE_EVENT_EX_PROTOCOL_REVISION
,
OcEventExSetPointerScale
,
{
APPLE_EVENT_PROTOCOL_REVISION
,
EventRegisterHandler
,
EventUnregisterHandler
,
EventSetCursorPosition
,
EventSetEventName
,
EventIsCapsLockOn
}
};
// AppleEventUnload
...
...
@@ -536,11 +555,13 @@ AppleEventUnload (
InternalUnregisterHandlers
();
InternalCancelPollEvents
();
Status
=
gBS
->
UninstallProtocolInterface
(
gImageHandle
,
&
gAppleEventProtocolGuid
,
(
VOID
*
)
&
mAppleEventProtocol
);
Status
=
gBS
->
UninstallMultipleProtocolInterfaces
(
gImageHandle
,
&
gAppleEventProtocolGuid
,
(
VOID
*
)
&
mAppleEventProtocol
.
AppleEvent
,
&
gOcAppleEventExProtocolGuid
,
&
mAppleEventProtocol
);
return
Status
;
}
...
...
@@ -565,7 +586,6 @@ OcAppleEventInstallProtocol (
{
EFI_STATUS
Status
;
APPLE_EVENT_PROTOCOL
*
Protocol
;
EFI_HANDLE
NewHandle
;
DEBUG
((
DEBUG_VERBOSE
,
"OcAppleEventInstallProtocol
\n
"
));
...
...
@@ -590,16 +610,14 @@ OcAppleEventInstallProtocol (
InternalSetKeyDelays
(
KeyInitialDelay
,
KeySubsequentDelay
);
//
// Apple code supports unloading, ours does not.
//
NewHandle
=
NULL
;
Status
=
gBS
->
InstallProtocolInterface
(
&
NewHandle
,
&
gAppleEventProtocolGuid
,
EFI_NATIVE_INTERFACE
,
(
VOID
*
)
&
mAppleEventProtocol
);
Status
=
gBS
->
InstallMultipleProtocolInterfaces
(
&
gImageHandle
,
&
gAppleEventProtocolGuid
,
&
mAppleEventProtocol
.
AppleEvent
,
&
gOcAppleEventExProtocolGuid
,
&
mAppleEventProtocol
,
NULL
);
if
(
!
EFI_ERROR
(
Status
))
{
InternalCreateQueueEvent
();
...
...
@@ -614,5 +632,5 @@ OcAppleEventInstallProtocol (
}
DEBUG
((
DEBUG_INFO
,
"OCAE: Installed
\n
"
));
return
&
mAppleEventProtocol
;
return
&
mAppleEventProtocol
.
AppleEvent
;
}
Library/OcAppleEventLib/OcAppleEventLib.inf
浏览文件 @
6b8b363d
...
...
@@ -44,6 +44,7 @@
[Protocols]
gAppleEventProtocolGuid ## SOMETIMES_PRODUCES
gOcAppleEventExProtocolGuid ## SOMETIMES_PRODUCES
gAppleKeyMapDatabaseProtocolGuid ## SOMETIMES_CONSUMES
gAppleKeyMapAggregatorProtocolGuid ## SOMETIMES_CONSUMES
gEfiConsoleControlProtocolGuid ## SOMETIMES_CONSUMES
...
...
Library/OcAppleEventLib/PointerHandler.c
浏览文件 @
6b8b363d
...
...
@@ -46,6 +46,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define POINTER_POLL_FREQUENCY EFI_TIMER_PERIOD_MILLISECONDS (10)
#define MAX_POINTER_POLL_FREQUENCY EFI_TIMER_PERIOD_MILLISECONDS (80)
GLOBAL_REMOVE_IF_UNREFERENCED
UINT32
mPointerScale
=
1
;
STATIC
UINT16
mMaximumDoubleClickSpeed
=
75
;
// 374 for 2 ms
STATIC
UINT16
mMaximumClickDuration
=
15
;
// 74 for 2 ms
...
...
@@ -708,9 +710,11 @@ InternalSimplePointerPollNotifyFunction (
UiScaleX
=
InternalGetUiScaleData
((
INT64
)
State
.
RelativeMovementX
);
UiScaleX
=
MultS64x64
(
UiScaleX
,
(
INT64
)
mMaxPointerResolutionX
);
UiScaleX
=
MultS64x64
(
UiScaleX
,
mPointerScale
);
UiScaleY
=
InternalGetUiScaleData
((
INT64
)
State
.
RelativeMovementY
);
UiScaleY
=
MultS64x64
(
UiScaleY
,
(
INT64
)
mMaxPointerResolutionY
);
UiScaleY
=
MultS64x64
(
UiScaleY
,
mPointerScale
);
if
(
SimplePointer
->
Mode
->
ResolutionX
>
0
)
{
UiScaleX
=
DivS64x64Remainder
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录