aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS-TheRevival/Functions/InGame/Hardwares/KeyboardHandler.vb
blob: 26aca44627caaf93779b5613cef4151a6db89464 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Imports System.IO

Module KeyboardHandler
    Public InputKey As Keys

    Public Sub ShortcutHandle()
        Select Case InputKey
            Case (Keys.Control + Keys.Q)
                If Console.CurrentInterpreter = "terminal" Then
                Else
                    TerminateApp(KeyInput)
                    TextRebind()
                End If
            Case Else
                ExecKeyBinding(KeyInput)
        End Select
    End Sub

    Public Sub ExecKeyBinding(KeyInput As Keys)
        Select Case KeyInput
            Case (Keys.S + Keys.Control)
                Select Case Console.CurrentInterpreter
                    Case "textpad"
                        If File.Exists(Console.CurrentDirectory & "\" & command) = True Then
                            Dim TempCompare As String = File.ReadAllText(Console.CurrentDirectory & "\" & command)
                            If Console.TextBox1.Text = TempCompare Then

                            Else
                                Dim BeforeCP As Integer = Strings.ComputerInfo(2)
                                SaveFile(command)
                                TextPad_GenerateCP_SavedFile()
                                Dim AfterCP As Integer = Strings.ComputerInfo(2) - BeforeCP
                                Console.ToolBar.Text = "TextPad - " & command & " - You've got " & AfterCP & " Codepoints" & Environment.NewLine & "Ctrl-Q Exit | Ctrl-N New | Ctrl-O Open | Ctrl-S Save | F12 Save As"
                            End If
                        Else
                            Dim BeforeCP As Integer = Strings.ComputerInfo(2)
                            SaveFile(command)
                            TextPad_GenerateCP_SavedFile()
                            Dim AfterCP As Integer = Strings.ComputerInfo(2) - BeforeCP
                            Console.ToolBar.Text = "TextPad - " & command & " - You've got " & AfterCP & " Codepoints" & Environment.NewLine & "Ctrl-Q Exit | Ctrl-N New | Ctrl-O Open | Ctrl-S Save | F12 Save As"
                        End If
                End Select
            Case (Keys.N + Keys.Control)
                Select Case Console.CurrentInterpreter
                    Case "textpad"
                        Console.TextBox1.Text = Nothing
                End Select
        End Select
    End Sub

End Module