!39326 修改OH_ArkUI_DragEvent_GetModifierKeyStates接口只有无符号整数才能进行位运算

Merge pull request !39326 from Zhang Jinyu/modifierKeysState
This commit is contained in:
openharmony_ci 2024-08-01 08:24:27 +00:00 committed by Gitee
commit ca79efb4c9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 6 additions and 5 deletions

View File

@ -57,6 +57,7 @@ typedef long long ArkUI_Int64;
typedef float ArkUI_Float32;
typedef double ArkUI_Float64;
typedef const char* ArkUI_CharPtr;
typedef unsigned long long ArkUI_Uint64;
// Several opaque struct declarations.
struct _ArkUIVMContext;
@ -236,7 +237,7 @@ struct ArkUIDragEvent {
ArkUI_Float64 displayY;
ArkUI_Float64 screenX;
ArkUI_Float64 screenY;
ArkUI_Int64 modifierKeyState;
ArkUI_Uint64 modifierKeyState;
ArkUI_Int32 dragBehavior;
bool useCustomDropAnimation;
ArkUI_Int32 subKind;

View File

@ -57,7 +57,7 @@
namespace OHOS::Ace::NG {
namespace NodeModifier {
int64_t CalculateModifierKeyState(const std::vector<OHOS::Ace::KeyCode>& status)
uint64_t CalculateModifierKeyState(const std::vector<OHOS::Ace::KeyCode>& status)
{
uint64_t modifierKeysState = 0;
// check ctrl
@ -80,7 +80,7 @@ int64_t CalculateModifierKeyState(const std::vector<OHOS::Ace::KeyCode>& status)
modifierKeysState |= ARKUI_MODIFIER_KEY_FN;
}
return static_cast<int64_t>(modifierKeysState);
return modifierKeysState;
}
void SetDragEventProperty(const RefPtr<OHOS::Ace::DragEvent>& info, ArkUINodeEvent& event,

View File

@ -431,7 +431,7 @@ float OH_ArkUI_DragEvent_GetVelocity(ArkUI_DragEvent* event);
* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
* @since 12
*/
int32_t OH_ArkUI_DragEvent_GetModifierKeyStates(ArkUI_DragEvent* event, int64_t* keys);
int32_t OH_ArkUI_DragEvent_GetModifierKeyStates(ArkUI_DragEvent* event, uint64_t* keys);
/**
* @brief Sets whether to enable strict reporting on drag events.

View File

@ -41,7 +41,7 @@ constexpr int32_t MAX_POINTID = 9;
constexpr int32_t MIN_POINTID = 0;
} // namespace
int32_t OH_ArkUI_DragEvent_GetModifierKeyStates(ArkUI_DragEvent* event, int64_t* keys)
int32_t OH_ArkUI_DragEvent_GetModifierKeyStates(ArkUI_DragEvent* event, uint64_t* keys)
{
if (!event || !keys) {
return ARKUI_ERROR_CODE_PARAM_INVALID;