(01-29-2026, 09:07 PM)SMcNeill Wrote: GLUT is brokes. It doesn't read any of the top row of keys with CTRL.
You could try ALT instead or SHIFT.
GLUT stinks!
For now I'll use Alt. Hey it works, but wow, I have a lot of work to do to get everything to resize properly. All the hardware images would have to be redrawn, for one.
Oh, the basic screen resize stuff...
Code: (Select All)
Dim Shared t.FSize As Integer
If t.FSize = 0 Then t.FSize = _FontHeight
Type MouseVar
x As _Byte
y As _Byte
lb As _Byte
rb As _Byte
mb As _Byte
mw As _Byte
clkcnt As _Byte
caps As _Byte
shift As _Byte
ctrl As _Byte
alt As _Byte
AltSwitch As _Byte
prevx As _Byte
prevy As _Byte
drag As _Byte
sbar As _Byte
sbRow As _Byte
oldsbRow As _Byte
ThumbTop As _Byte
ThumbSize As _Byte
ThumbDrag As _Byte
autokey As String
Pointer As _Byte
End Type
Dim m As MouseVar
Do
_Limit 30
Mouse_Keyboard m, b$
If Len(b$) Then Print b$
If m.alt Then
If b$ = Chr$(0) + "ƒ" Then t.FSize = t.FSize + 1: FontSize
If b$ = Chr$(0) + "‚" Then t.FSize = t.FSize - 1: FontSize
End If
Loop
Sub FontSize
Static CurrentFont&
rootpath$ = Environ$("SYSTEMROOT")
fontfile$ = rootpath$ + "\Fonts\lucon.ttf"
style$ = "monospace"
f& = _LoadFont(fontfile$, t.FSize, style$)
_Font f&
If CurrentFont& > 0 Then _FreeFont CurrentFont&: Sound 1000, 1
CurrentFont& = f&
Print "Hello!"
End Sub
Sub Mouse_Keyboard (m As MouseVar, b$)
Static z1
If Len(m.autokey) Then
b$ = Mid$(m.autokey + ",", 1, InStr(m.autokey$ + ",", ",") - 1)
m.autokey = Mid$(m.autokey, InStr(m.autokey$ + ",", ",") + 1) ' Don't add "," tomid$() portion or the last key will always be a comma.
Else
b$ = InKey$
End If
m.prevx = m.x: m.prevy = m.y
If m.mw Then m.mw = 0
While _MouseInput
m.mw = m.mw + _MouseWheel: If m.mw Then m.mw = m.mw \ Abs(m.mw) ' Limit to 1 or -1 for up or down.
Wend
m.x = _MouseX
m.y = _MouseY
If z1 Then If Abs(Timer - z1) > .25 Then z1 = 0: m.clkcnt = 0
Select Case m.lb
Case 2: m.lb = 0 ' Click cycle completed.
Case 1: If _MouseButton(1) = 0 Then m.lb = 2: m.drag = 0: m.ThumbDrag = 0 ' Button released.
Case -1: m.lb = 1 ' Button held down.
Case 0: m.lb = _MouseButton(1)
End Select
Select Case m.rb
Case 2: m.rb = 0 ' Click cycle completed.
Case 1: If _MouseButton(2) = 0 Then m.rb = 2 ' Button released.
Case -1: m.rb = 1 ' Button held down.
Case 0: m.rb = _MouseButton(2)
End Select
Select Case m.mb
Case 2: m.mb = 0 ' Click cycle completed.
Case 1: If _MouseButton(3) = 0 Then m.mb = 2 ' Button released.
Case -1: m.mb = 1 ' Button held down.
Case 0: m.mb = _MouseButton(3)
End Select
If Abs(m.lb) = 1 Then
If m.lb = -1 Then z1 = Timer: m.clkcnt = m.clkcnt + 1
If m.prevx And m.prevx <> m.x Or m.prevy And m.prevy <> m.y Then
If m.x <> m.prevx Then m.drag = Sgn(m.x - m.prevx) ' Prevent zero which can occur if mouse moves off row when being draged horizontally.
End If
End If
If _KeyDown(100301) Then m.caps = -1 Else If m.caps Then m.caps = 0
If _KeyDown(100303) Or _KeyDown(100304) Then m.shift = -1 Else If m.shift Then m.shift = 0
If _KeyDown(100305) Or _KeyDown(100306) Then m.ctrl = -1 Else If m.ctrl Then m.ctrl = 0
If _KeyDown(100307) Or _KeyDown(100308) Then m.alt = -1 Else If m.alt Then m.alt = 0
If m.AltSwitch = 4 Then m.AltSwitch = 0 ' Cycle complete.
Select Case m.alt
Case _TRUE
If m.AltSwitch = 0 Then m.AltSwitch = 1 Else If m.AltSwitch = 2 Then m.AltSwitch = 3
Case Else
If m.AltSwitch = 1 Then m.AltSwitch = 2 Else If m.AltSwitch = 3 Then m.AltSwitch = 4
End Select
End Sub

