Visual Basic - 密钥列表(Gamecontroller?)

时间:2013-05-16 20:33:45

标签: vb6 key gamecontroller

如何找到Gamecontroller-Key的特定值?

我想将它们用于游戏中的脚本。

示例:

isKeyPressed(Settings.GetValueKey("Key", Keys.X))

以下是我找到的唯一键值:

http://msdn.microsoft.com/en-us/library/aa243025(v=vs.60).aspx

1 个答案:

答案 0 :(得分:0)

如果你想走这条路线,如Deanna建议的那样使用DirectShow或WinMM,你需要一个键盘模拟器用于你的游戏手柄,这是一个相关的问题:

https://gaming.stackexchange.com/questions/13575/emulating-keyboard-and-mouse-commands-with-a-game-controller-control-pad-whi

如果您需要获取应用上箭头键的事件,请确保表格属性上的KeyPreview为True。

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    'On Error Resume Next
    Select Case KeyCode
        Case vbKeyUp
            MsgBox "Up"
        Case vbKeyDown
            MsgBox "Down"
        Case vbKeyLeft
            MsgBox "Left"
        Case vbKeyRight
            MsgBox "Right"
    End Select
End Sub

Source