[Code] Logitech G15
- HeX0R
- Beiträge: 3042
- Registriert: 10.09.2004 09:59
- Computerausstattung: AMD Ryzen 7 5800X
96Gig Ram
NVIDIA GEFORCE RTX 3060TI/8Gig
Win11 64Bit
G19 Tastatur
2x 24" + 1x27" Monitore
Glorious O Wireless Maus
PB 3.x-PB 6.x
Oculus Quest 2 + 3 - Kontaktdaten:
Code: Alles auswählen
;Shows a ProgressBar on a G15 (if available)
;If you don't own a G15 keyboard change to #False:
XIncludeFile "G15_Source.pb"
#HAS_G15_KEYBOARD = #True
Structure _G15_STATIC_VARS_
Device.l
Connection.l
ImageID.l
EndStructure
Procedure G15_Show_Progress(Progress, ProgramName.s = "")
;Progress goes from 0 to 100.
;If you send -1, Application will close connection to the G15
Protected ctx.lgLcdConnectContext, ctxo.lgLcdOpenContext
Protected InitMode
Static G15._G15_STATIC_VARS_
If Progress < -1
Progress = -1
ElseIf Progress > 100
Progress = 100
EndIf
If G15\Device = 0
;First Call!
If #HAS_G15_KEYBOARD
InitMode = #LGLCD_INIT_NORMAL; | #LGLCD_INIT_ADD_DISPLAY
Else
InitMode = #LGLCD_INIT_ONLY_DISPLAY
EndIf
If lgLcdInit(InitMode) = #ERROR_SUCCESS
ctx\appFriendlyName = @ProgramName
ctx\isPersistent = #False
ctx\isAutostartable = #False
If lgLcdConnect(@ctx) <> #ERROR_SUCCESS
lgLcdDeInit()
Else
ctxo\connection = ctx\connection
ctxo\index = 0
G15\Connection = ctx\connection
If lgLcdOpen(@ctxo) <> #ERROR_SUCCESS
lgLcdDisconnect(G15\Connection)
lgLcdDeInit()
Else
G15\Device = ctxo\Device
G15\ImageID = CreateImage(#PB_Any, #LGLCD_BMP_WIDTH, #LGLCD_BMP_HEIGHT, 8) ;<- Only 8Bit supported!
;Create RawPicture
StartDrawing(ImageOutput(G15\ImageID))
FillArea(0, 0, -1, $FFFFFF)
DrawText((#LGLCD_BMP_WIDTH - TextWidth("Loading " + ProgramName)) / 2, 5, "Loading " + ProgramName, 0)
Box(20, 30, Progress, 10, 0)
DrawText(125, 26, Str(Progress) + "%")
StopDrawing()
If lgLcdUpdateBitmap(G15\Device,G15\ImageID, LGLCD_ASYNC_UPDATE(#LGLCD_PRIORITY_ALERT)) = #ERROR_SUCCESS
lgLcdSetAsLCDForegroundApp(G15\Device, #LGLCD_LCD_FOREGROUND_APP_YES)
EndIf
EndIf
EndIf
EndIf
ElseIf Progress = -1
lgLcdClose(G15\Device)
lgLcdDisconnect(G15\Connection)
lgLcdDeInit()
G15\Device = 0
FreeImage(G15\ImageID)
ElseIf IsImage(G15\ImageID)
StartDrawing(ImageOutput(G15\ImageID))
Box(20, 30, Progress, 10, 0)
DrawText(125, 26, Str(Progress) + "%")
StopDrawing()
lgLcdUpdateBitmap(G15\Device, G15\ImageID, LGLCD_ASYNC_UPDATE(#LGLCD_PRIORITY_ALERT))
EndIf
EndProcedure
;-------------------------
;Example!!
Procedure main()
OpenWindow(0, 250, 250, 220, 44, "Progress Test...", #PB_Window_SystemMenu)
TextGadget(0, 10, 14, 200, 20, "Watch your Display", #PB_Text_Center)
Repeat
Select WaitWindowEvent(20)
Case #PB_Event_CloseWindow
G15_Show_Progress(-1)
Break
Case 0
If i < 101
G15_Show_Progress(i, "My Application")
i + 1
ElseIf i = 101
i = 102
SetGadgetText(0, "Application loaded. Ready to Rumble...")
EndIf
EndSelect
ForEver
EndProcedure
main()
{Home}.:|:.{Codes}.:|:.{Downloads}.:|:.{History Viewer Online}.:|:.{Bier spendieren}
- HeX0R
- Beiträge: 3042
- Registriert: 10.09.2004 09:59
- Computerausstattung: AMD Ryzen 7 5800X
96Gig Ram
NVIDIA GEFORCE RTX 3060TI/8Gig
Win11 64Bit
G19 Tastatur
2x 24" + 1x27" Monitore
Glorious O Wireless Maus
PB 3.x-PB 6.x
Oculus Quest 2 + 3 - Kontaktdaten:
Hier steht alles drin.
(Das gleiche hast du auch im SDK)
(Das gleiche hast du auch im SDK)
{Home}.:|:.{Codes}.:|:.{Downloads}.:|:.{History Viewer Online}.:|:.{Bier spendieren}
- HeX0R
- Beiträge: 3042
- Registriert: 10.09.2004 09:59
- Computerausstattung: AMD Ryzen 7 5800X
96Gig Ram
NVIDIA GEFORCE RTX 3060TI/8Gig
Win11 64Bit
G19 Tastatur
2x 24" + 1x27" Monitore
Glorious O Wireless Maus
PB 3.x-PB 6.x
Oculus Quest 2 + 3 - Kontaktdaten:
Vielleicht kaut es dir ja noch jemand vor (ich nicht), bis dahin probiers mal hiermit:


{Home}.:|:.{Codes}.:|:.{Downloads}.:|:.{History Viewer Online}.:|:.{Bier spendieren}