📄 frmmain.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "Keyboard Info Demo"
ClientHeight = 3195
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 2 '屏幕中心
Begin VB.Timer Timer1
Left = 120
Top = 2640
End
Begin VB.CommandButton Command1
Caption = "获取键盘信息"
Height = 495
Left = 120
TabIndex = 0
Top = 120
Width = 4455
End
Begin VB.Label lblcaretflash
Height = 255
Left = 120
TabIndex = 4
Top = 2280
Width = 4095
End
Begin VB.Label lblrepeatdelay
Height = 255
Left = 120
TabIndex = 3
Top = 1800
Width = 4455
End
Begin VB.Label lblrepeatspeed
Height = 255
Left = 120
TabIndex = 2
Top = 1320
Width = 4455
End
Begin VB.Label lblkeyboard
Height = 255
Left = 120
TabIndex = 1
Top = 840
Width = 4455
End
Begin VB.Shape ShapeCusor
FillStyle = 0 'Solid
Height = 255
Left = 4440
Top = 2280
Width = 135
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim r As Long
Dim t As String
Dim k As Long
Dim q As Long
k = GetKeyboardType(0)
If k = 1 Then t = "PC or compatible 83-key keyboard"
If k = 2 Then t = "Olivetti 102-key keyboard"
If k = 3 Then t = "AT or compatible 84-key keyboard"
If k = 4 Then t = "Enhanced(IBM) 101-102-key keyboard"
If k = 5 Then t = "Nokia 1050 keyboard"
If k = 6 Then t = "Nokia 9140 keyboard"
If k = 7 Then t = "Japanese keyboard"
lblkeyboard = "键盘类型: " & t
q = SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, r, 0)
lblrepeatdelay = "键盘重复的延缓时间 = " & r & " Seconds"
q = SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, r, 0)
scrRepeatSpeed = r
lblrepeatspeed = "键盘重复的速度 = " & r & " characters per second."
Timer1.Interval = GetCaretBlinkTime
scrCaretFlash = GetCaretBlinkTime
lblcaretflash = "光标闪烁速度 = " & GetCaretBlinkTime & "ms"
End Sub
Private Sub Timer1_Timer()
Shape1.Visible = Not Shape1.Visible
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -