Move a widget by holding down mouse key and space key

Hey all,
I am trying to move a widget by holding down mouse key and space key at same time, added this interaction with this logic:

It works fine but only for first time, after that it doesnt require space key to move the widget. How can I make it required action for every time?

Thanks

Hi!

Testing whether a key pressed works best when it’s a keyboard message. (OnKeyDown, etc.) You can use the strategy from this post for testing if space is pressed when you are dragging (even though the post was about clicking).

1 Like

Thanks it worked but I didnt exactly understand second logic. Why second logic is same as first one but make variable false?

Hi!

Because it’s testing for two different messages. The first one is testing for when the key is pressed down, and the second is testing for when the key released.

1 Like