vbscript 按下键的民意调查。您可以对指定的按键作出反应。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vbscript 按下键的民意调查。您可以对指定的按键作出反应。相关的知识,希望对你有一定的参考价值。

Module MM
    Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Long, ByVal dwExtraInfo As Integer)
    Public Declare Function SetCursorPos Lib "user32" (ByVal x As Integer, ByVal y As Integer) As Integer
    Public Declare Function GetCursorPos Lib "user32" (ByRef lpPoint As POINTAPI) As Long
    Public Declare Function GetAsyncKeyState Lib "user32" (ByVal key As Integer) As Integer
    Public Const MOUSEEVENTF_LEFTDOWN = &H2
    Public Const MOUSEEVENTF_LEFTUP = &H4
    Public Const MOUSEEVENTF_MIDDLEDOWN = &H20
    Public Const MOUSEEVENTF_MIDDLEUP = &H40
    Public Const MOUSEEVENTF_RIGHTDOWN = &H8
    Public Const MOUSEEVENTF_RIGHTUP = &H10
    Public Const MOUSEEVENTF_MOVE = &H1
    Public Structure POINTAPI
        Dim x As Integer
        Dim y As Integer
    End Structure
    Public Function GetX() As Long
        Dim n As POINTAPI
        GetCursorPos(n)
        GetX = n.x
    End Function
    Public Function GetY() As Long
        Dim n As POINTAPI
        GetCursorPos(n)
        GetY = n.y

    End Function
    Public Function getKeypressed(ByVal k As Windows.Forms.Keys)
        Dim i As Integer = GetAsyncKeyState(k)
        If i <> 0 Then
            Return True
        Else
            Return False
        End If
    End Function
    Public Sub LeftClick()
        LeftDown()
        LeftUp()
    End Sub
    Public Sub LeftDown()
        mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
    End Sub
    Public Sub LeftUp()
        mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
    End Sub
    Public Sub MiddleClick()
        MiddleDown()
        MiddleUp()
    End Sub
    Public Sub MiddleDown()
        mouse_event(MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0)
    End Sub
    Public Sub MiddleUp()
        mouse_event(MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0)
    End Sub
    Public Sub RightClick()
        RightDown()
        RightUp()
    End Sub
    Public Sub RightDown()
        mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0)
    End Sub
    Public Sub RightUp()
        mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
    End Sub
    Public Sub MoveMouse(ByVal xMove As Long, ByVal yMove As Long)
        mouse_event(MOUSEEVENTF_MOVE, xMove, yMove, 0, 0)
    End Sub
    Public Sub SetMousePos(ByVal xPos As Long, ByVal yPos As Long)
        SetCursorPos(xPos, yPos)
    End Sub
End Module

以上是关于vbscript 按下键的民意调查。您可以对指定的按键作出反应。的主要内容,如果未能解决你的问题,请参考以下文章

有没有办法从 Instagram 故事中检索民意调查选民名单?

R语言对苏格兰独立民意调查的Meta分析

如何对表示具有多个答案的民意调查的两个表使用一个查询?

按下键后如何获取编辑文本的文本

如何为 Meteor 构建 mongodb

在Android中使用虚拟键盘按下键?