StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
liuchina  
#1 Posted : Thursday, February 18, 2021 2:04:17 AM(UTC)
liuchina

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 9/26/2018(UTC)
Posts: 73
China
Location: 北京

Thanks: 18 times
Was thanked: 1 time(s) in 1 post(s)
It works like 'sp.IsKeyToggled(vk.CAPITAL);'.
Thanks.
Rob  
#2 Posted : Thursday, February 18, 2021 2:21:13 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Code:
if(sp.GetKeyState(vk.LBUTTON) & 0x8000) {
    sp.MessageBox("Left down", "Left")
}

if(sp.GetKeyState(vk.MBUTTON) & 0x8000) {
    sp.MessageBox("Middle down", "Middle")
}
thanks 1 user thanked Rob for this useful post.
liuchina on 2/18/2021(UTC)
liuchina  
#3 Posted : Thursday, February 18, 2021 8:29:30 AM(UTC)
liuchina

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 9/26/2018(UTC)
Posts: 73
China
Location: 北京

Thanks: 18 times
Was thanked: 1 time(s) in 1 post(s)
Thank you Rob!
liuchina  
#4 Posted : Friday, February 19, 2021 12:18:51 AM(UTC)
liuchina

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 9/26/2018(UTC)
Posts: 73
China
Location: 北京

Thanks: 18 times
Was thanked: 1 time(s) in 1 post(s)
HelloRob. About sp.GetKeyState, how can it monitor the scrolling state of the mouse wheel? I looked up some introduction information of VK key value, but it seems that there is no such content.

Edited by user Friday, February 19, 2021 12:20:59 AM(UTC)  | Reason: Not specified

Rob  
#5 Posted : Friday, February 19, 2021 2:11:17 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Scroll events don't have a "state", because they cannot be held down, they just happen instantly.

You can use Global Actions > Mouse Events > Mouse Wheel to catch those events and do stuff, but you can't check the state of the mouse wheel as it fires and that's the end of it.

You can also use the mouse wheel event hook:

https://forum.strokesplus.net/posts/t7209-Mouse---Keyboard-Event-Subscriptions
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.