
vb 6.0 keycode 问题
constshift=1constctrl=2constalt=4请问为什么shiftandshift>0就是按了shiftshiftandctrl>0就是按了Ctrls...
const shift=1
const ctrl=2
const alt=4
请问为什么shift and shift>0 就是按了shift
shift and ctrl>0 就是按了Ctrl
shift and Alt>0 就是按了Alt 展开
const ctrl=2
const alt=4
请问为什么shift and shift>0 就是按了shift
shift and ctrl>0 就是按了Ctrl
shift and Alt>0 就是按了Alt 展开
展开全部
参照我以下的代码吧,相关解说不用了吧?
If Shift > 3 Then
KeyAlt.Value = 1
a = Shift - 4
If a - 1 > 0 Then
KeyCtrl.Value = 1
B = a - 2
If B <> 0 Then
KeyShift.Value = 1
Else
KeyShift.Value = 0
End If
ElseIf a - 1 = 0 Then
KeyShift.Value = 1
KeyCtrl.Value = 0
Else
KeyCtrl.Value = 0
KeyShift.Value = 0
End If
ElseIf Shift > 2 Then
KeyShift.Value = 1
KeyCtrl.Value = 1
KeyAlt.Value = 0
ElseIf Shift = 2 Then
KeyCtrl.Value = 1
KeyShift.Value = 0
KeyAlt.Value = 0
ElseIf Shift = 1 Then
KeyCtrl.Value = 0
KeyShift.Value = 1
KeyAlt.Value = 0
elseif shift=0 then
KeyCtrl.Value = 0
KeyShift.Value = 0
KeyAlt.Value = 0
endif
If Shift > 3 Then
KeyAlt.Value = 1
a = Shift - 4
If a - 1 > 0 Then
KeyCtrl.Value = 1
B = a - 2
If B <> 0 Then
KeyShift.Value = 1
Else
KeyShift.Value = 0
End If
ElseIf a - 1 = 0 Then
KeyShift.Value = 1
KeyCtrl.Value = 0
Else
KeyCtrl.Value = 0
KeyShift.Value = 0
End If
ElseIf Shift > 2 Then
KeyShift.Value = 1
KeyCtrl.Value = 1
KeyAlt.Value = 0
ElseIf Shift = 2 Then
KeyCtrl.Value = 1
KeyShift.Value = 0
KeyAlt.Value = 0
ElseIf Shift = 1 Then
KeyCtrl.Value = 0
KeyShift.Value = 1
KeyAlt.Value = 0
elseif shift=0 then
KeyCtrl.Value = 0
KeyShift.Value = 0
KeyAlt.Value = 0
endif
参考资料: 出自我的程序PowerTimer中的部分代码
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询