Logitech G15-Display
wollte mich mal für den source bedanken - hat mir sehr geholfen!
mein erstes kleines applet ist ein spiel /through the asteroid belt) und zu finden unter g15-applets.de.

So nu hab ich sie auch und muss sagen das die Tastatur nicht
fuer meine Wurstfinger geeignet ist
. Aber das wird sich wohl
noch geben.
Jetzt habe ich das Beispiel von HeX0R ausprobiert und es sieht
auch toll aus, aber ich versteh es nicht wirklich. Koennte da mal
jemand ein kleines Beispiel mit einfacher Textausgabe posten ?
Danke.
fuer meine Wurstfinger geeignet ist

noch geben.
Jetzt habe ich das Beispiel von HeX0R ausprobiert und es sieht
auch toll aus, aber ich versteh es nicht wirklich. Koennte da mal
jemand ein kleines Beispiel mit einfacher Textausgabe posten ?
Danke.
- HeX0R
- Beiträge: 3040
- 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:
Klar doch.
Priorität ist Normal, daher musst du erst am Display umschalten, bevor du was siehst.
Code: Alles auswählen
XIncludeFile "G15_Header.pbi"
Enumeration
#Window_0
EndEnumeration
Enumeration
#Text_0
#Text_1
#Text_2
#Text_3
#Text_4
#Button_0
#String_0
EndEnumeration
Procedure Open_Window_0()
If OpenWindow(#Window_0, 522, 122, 372, 167, "G15 Display", #PB_Window_SystemMenu | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
TextGadget(#Text_0, 10, 12, 70, 20, "Display-Text:")
StringGadget(#String_0, 90, 10, 280, 20, "Dies ist ein Test")
TextGadget(#Text_1, 10, 50, 80, 20, "Button 1 pressed")
TextGadget(#Text_2, 100, 50, 80, 20, "Button 2 pressed")
TextGadget(#Text_3, 190, 50, 80, 20, "Button 3 pressed")
TextGadget(#Text_4, 280, 50, 80, 20, "Button 4 pressed")
ButtonGadget(#Button_0, 300, 140, 70, 20, "Cancel")
DisableGadget(#Text_1, 1)
DisableGadget(#Text_2, 1)
DisableGadget(#Text_3, 1)
DisableGadget(#Text_4, 1)
EndIf
EndIf
EndProcedure
Procedure.l lgLcdOnSoftButtonsCB(device.l, dwButtons.l, pContext.l)
If dwButtons & #LGLCDBUTTON_BUTTON0
DisableGadget(#Text_1, 0)
Else
DisableGadget(#Text_1, 1)
EndIf
If dwButtons & #LGLCDBUTTON_BUTTON1
DisableGadget(#Text_2, 0)
Else
DisableGadget(#Text_2, 1)
EndIf
If dwButtons & #LGLCDBUTTON_BUTTON2
DisableGadget(#Text_3, 0)
Else
DisableGadget(#Text_3, 1)
EndIf
If dwButtons & #LGLCDBUTTON_BUTTON3
DisableGadget(#Text_4, 0)
Else
DisableGadget(#Text_4, 1)
EndIf
EndProcedure
Procedure SetText(*ctxo.lgLcdOpenContext, *bitmapbuffer, FontID.l, Text.s)
If CreateImage(0, 160, 43, 8)
StartDrawing(ImageOutput(0))
FillArea(1, 1, -1, RGB(255, 255, 255))
DrawingFont(FontID)
DrawText(5, 7, Text, 0)
StopDrawing()
If Img2G15(0, *bitmapbuffer)
lgLcdUpdateBitmap(*ctxo\device, *bitmapbuffer, LGLCD_ASYNC_UPDATE(#LGLCD_PRIORITY_NORMAL))
EndIf
EndIf
EndProcedure
Procedure Main()
Protected ctx.lgLcdConnectContext, ctxo.lgLcdOpenContext, *bitmapbuffer, FID.l
*bitmapbuffer = AllocateMemory(SizeOf(lgLcdBitmap160x43x1))
FID = LoadFont(0, "Tahoma", 14)
If lgLcdInit() <> #ERROR_SUCCESS
MessageRequester("Error!", "Can't initialize G15-Display!")
End
EndIf
ctx\appFriendlyName = @"Schreibtest"
ctx\isPersistent = 0
ctx\isAutostartable = 0
ctxo\onSoftbuttonsChanged\softbuttonsChangedCallback = @lgLcdOnSoftButtonsCB()
ctxo\onSoftbuttonsChanged\softbuttonsChangedContext = 0
If lgLcdConnect(@ctx) <> #ERROR_SUCCESS
MessageRequester("Error!", "Can't Connect to G15-Display")
lgLcdDeInit()
End
EndIf
;-Start here
ctxo\connection = ctx\connection
ctxo\index = 0
If lgLcdOpen(@ctxo) = #ERROR_SUCCESS
Open_Window_0()
SetText(@ctxo, *bitmapbuffer, FID, GetGadgetText(#String_0))
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
Select EventGadget()
Case #Button_0
Break
Case #String_0
If EventType() = #PB_EventType_Change
SetText(@ctxo, *bitmapbuffer, FID, GetGadgetText(#String_0))
EndIf
EndSelect
EndSelect
ForEver
lgLcdClose(ctxo\device)
EndIf
lgLcdDisconnect(ctx\connection)
lgLcdDeInit()
FreeMemory(*bitmapbuffer)
FreeFont(0)
EndProcedure
Main()
End
{Home}.:|:.{Codes}.:|:.{Downloads}.:|:.{History Viewer Online}.:|:.{Bier spendieren}