📄 keyboard input.vb.svn-base
字号:
'### Visual Basic.NET and Direct X9 Legend of MiR Project ###'
'### Mir Unleashed Client Keyboard Input Module ###'
'### http://www.lomcn.co.uk ###' '### Credits to TrueADM and DeathWish ###'
'Basically to handle keyboard inputs from the user.
Module KeyboardInput
Public Sub CheckKeyboardInput()
If TextboxSelect = True And Textbox(TextboxSelectIndex).Show = True And Textbox(TextboxSelectIndex).Scene = Scene Then
If DelDown = Keys.Delete And TextboxSelect = True And Not Len(Textbox(TextboxSelectIndex).Text) - Textbox(TextboxSelectIndex).TextPointer <= 0 Then
If Textbox(TextboxSelectIndex).TextPointer = Len(Textbox(TextboxSelectIndex).Text) - 1 Then
Textbox(TextboxSelectIndex).Text = Left(Textbox(TextboxSelectIndex).Text, Len(Textbox(TextboxSelectIndex).Text) - 1)
Else
Textbox(TextboxSelectIndex).Text = Mid(Textbox(TextboxSelectIndex).Text, 1, Textbox(TextboxSelectIndex).TextPointer) & Mid(Textbox(TextboxSelectIndex).Text, Right(Textbox(TextboxSelectIndex).TextPointer + 2, Len(Textbox(TextboxSelectIndex).Text) - Textbox(TextboxSelectIndex).TextPointer), Len(Textbox(TextboxSelectIndex).Text) - Textbox(TextboxSelectIndex).TextPointer)
End If
ElseIf DelDown = Keys.Delete And TextboxSelect = True And Len(Textbox(TextboxSelectIndex).Text) - Textbox(TextboxSelectIndex).TextPointer = 1 Then
Textbox(TextboxSelectIndex).Text = Mid(Textbox(TextboxSelectIndex).Text, 1, Len(Textbox(TextboxSelectIndex).Text) - 1)
ElseIf LeftDown = True And TextboxSelect = True And Not Len(Textbox(TextboxSelectIndex).Text) = 0 And Not Textbox(TextboxSelectIndex).TextPointer = 0 Then
Textbox(TextboxSelectIndex).TextPointer = Textbox(TextboxSelectIndex).TextPointer - 1
ElseIf RightDown = True And TextboxSelect = True And Not Textbox(TextboxSelectIndex).TextPointer > Len(Textbox(TextboxSelectIndex).Text) - 1 Then
Textbox(TextboxSelectIndex).TextPointer = Textbox(TextboxSelectIndex).TextPointer + 1
End If
End If
Select Case Scene
Case SceneType.GAME
'Game Scene
If ReturnDown Or (ShiftDown And Num1Down) Or (ShiftDown And AtDown) Or ForwardSlashDown Then
If ChatOn And ReturnDown Then
ChatOn = False
If Not Textbox(11).Text = "" Then
If PreText = "Whisper: " Then AddChat(Textbox(11).Text, ChatColours.Blue) : WhisperTarget = Split(Textbox(11).Text, " ")(0)
Packets.SendChat(Textbox(11).Text)
TextboxSelect = False
Textbox(11).Text = ""
Textbox(11).TextPointer = 0
ChatShowTick = DateTime.Now.Ticks
End If
Else
ChatOn = True
TextboxSelect = True
TextboxSelectIndex = 11
Textbox(11).Text = ""
Select Case True
Case ReturnDown
PreText = "Say: "
Case (ShiftDown And Num1Down)
PreText = "Shout: "
Case (ShiftDown And AtDown)
PreText = "Command: "
Case ForwardSlashDown
If WhisperTarget = "" Then
PreText = "Whisper: "
Else
Textbox(11).Text = WhisperTarget & " "
Textbox(11).TextPointer = WhisperTarget.Length + 1
RemoveSlash = True
End If
End Select
End If
End If
If VDown = True Then
If Map.MiniMapOption = 0 Then
Map.MiniMapOption = 1
ElseIf Map.MiniMapOption = 1 Then
Map.MiniMapOption = 2
ElseIf Map.MiniMapOption = 2 Then
Map.MiniMapOption = 0
End If
End If
If AltDown Then
If QDown Then
Running = False
End If
End If
If ChatOn = True Or ReturnDown = True Then
Exit Sub
Else
Select Case True
Case F1Down
'F1
MakeHealingMagicPart1(Actor.ServerID)
Case F2Down
'F2
MakeFlameFieldMagic(Actor.X, Actor.Y)
Case F3Down
'F3
Case F4Down
'F4
Case F5Down
'F5
Case F6Down
'F6
Case F7Down
'F7
Case F8Down
'F8
Case F9Down
'F9 Open/Close Bag
If Window(6).Show = False Then
Window(6).Show = True
Else
Window(6).Show = False
End If
Case IDown
'I Open/Close Bag
If Window(6).Show = False Then
Window(6).Show = True
Else
Window(6).Show = False
End If
End Select
End If
Case SceneType.LOGIN
'Login Scene
If Connected = True And LoginStage = LoginStageType.LOGIN Then
TextboxSelect = True
If TabDown Then
Select Case TextboxSelectIndex
Case 0
TextboxSelectIndex = 1
Case 1
TextboxSelectIndex = 0
End Select
End If
If ReturnDown Then
ButtonClick(3) 'Login
End If
End If
End Select
End Sub
End Module
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -