implemented the password stuff, but failed to be able to convert other than alphabet to its correspondant

This commit is contained in:
EverythingWindows 2022-11-19 06:17:02 +07:00
parent 996601e9cc
commit e73d05d3b0
2 changed files with 37 additions and 14 deletions

View file

@ -231,6 +231,9 @@
NormalCommand() NormalCommand()
SaveGame() SaveGame()
InitializeTerminal() InitializeTerminal()
'Case "secure"
' Console.Secure = True
' Console.TextBox1.ReadOnly = True
Case "shiftorium" Case "shiftorium"
NewLine(My.Resources.man_shiftorium) NewLine(My.Resources.man_shiftorium)
AdvancedCommand = False AdvancedCommand = False

View file

@ -15,6 +15,8 @@ Public Class Console
Public ToolBarUse As Boolean = False 'Either any program is using ToolBar or not Public ToolBarUse As Boolean = False 'Either any program is using ToolBar or not
Public ReleaseCursor As Boolean = False 'Release cursor from TrackPos Public ReleaseCursor As Boolean = False 'Release cursor from TrackPos
Public ShOSKey As String 'DOSKEY tracking string for ShiftOS Public ShOSKey As String 'DOSKEY tracking string for ShiftOS
Public Secure As Boolean 'Define either Secure Text mode is enabled or not (experimental!)
Public SecureString As String 'String for Secure Text mode (experimental)
Private Sub Console_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub Console_Load(sender As Object, e As EventArgs) Handles MyBase.Load
With ShortcutHandler With ShortcutHandler
@ -35,21 +37,31 @@ Public Class Console
Select Case e.KeyData Select Case e.KeyData
Case Keys.Enter Case Keys.Enter
e.SuppressKeyPress = True e.SuppressKeyPress = True
If TextBox1.ReadOnly = True Then If Secure = True Then
Secure = False
Else TextBox1.ReadOnly = False
Terminal_ReadCommand() Terminal_ReadCommand()
If Strings.AvailableFeature(18) = 1 Then NewLine(SecureString)
ShOSKey_InputCommand(command) Terminal_PrintPrompt()
End If SecureString = Nothing
If ChangeInterpreter = True Then TextRebind()
DoChildCommand() Else
Terminal_PrintPrompt() If TextBox1.ReadOnly = True Then
TextRebind()
Else Else
Terminal_DoCommand() Terminal_ReadCommand()
Terminal_PrintPrompt() If Strings.AvailableFeature(18) = 1 Then
TextRebind() ShOSKey_InputCommand(command)
End If
If ChangeInterpreter = True Then
DoChildCommand()
Terminal_PrintPrompt()
TextRebind()
Else
Terminal_DoCommand()
Terminal_PrintPrompt()
TextRebind()
End If
End If End If
End If End If
TrackPos = 0 TrackPos = 0
@ -113,7 +125,15 @@ Public Class Console
TextRebind() TextRebind()
End If End If
Case Else Case Else
TrackPos = TrackPos + 1 If Secure = True Then
If e.Modifiers = Keys.Shift Then
SecureString = SecureString & Chr(e.KeyValue)
Else
SecureString = SecureString & Chr(e.KeyValue + 32)
End If
Else
TrackPos = TrackPos + 1
End If
End Select End Select
End If End If
'If e.KeyCode = Keys.Enter Then 'If e.KeyCode = Keys.Enter Then