GtaSpider Posted September 25, 2007 Posted September 25, 2007 Hi Everyone, I've a question: I'll "put" smth on the LCD of the G15 (Gamer Keyboard). I know its possible with C and with VB. How can i make this in Autoit?: Dim LCD As New LCDInterface (This is VB) I'll write this in Autoit: CODEImports lgLCDClassLibrary Public Class Form1 Inherits System.Windows.Forms.Form '//************************************************************************ '// lgLcdBitmap '//************************************************************************ Public Const LGLCD_BMP_FORMAT_160x43x1 = 1 Public Const LGLCD_BMP_WIDTH = 160 Public Const LGLCD_BMP_HEIGHT = 43 Public Const LGLCD_SIZE = LGLCD_BMP_WIDTH * LGLCD_BMP_HEIGHT Public Structure lgLcdBitmapHeader Dim Format As Integer End Structure Public Structure lgLcdBitmap160x43x1 Dim hdr As lgLcdBitmapHeader Dim pixels() As Byte End Structure Dim bmp As lgLcdBitmap160x43x1 Dim modValue As Integer Dim LCD As New LCDInterface #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents ButtonOpenLCD As System.Windows.Forms.Button Friend WithEvents ButtonDisplayBitmap As System.Windows.Forms.Button Friend WithEvents ButtonCloseLCD As System.Windows.Forms.Button Friend WithEvents ButtonReadButtons As System.Windows.Forms.Button Friend WithEvents TextBoxButtons As System.Windows.Forms.TextBox <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.ButtonOpenLCD = New System.Windows.Forms.Button Me.ButtonDisplayBitmap = New System.Windows.Forms.Button Me.ButtonCloseLCD = New System.Windows.Forms.Button Me.ButtonReadButtons = New System.Windows.Forms.Button Me.TextBoxButtons = New System.Windows.Forms.TextBox Me.SuspendLayout() ' 'ButtonOpenLCD ' Me.ButtonOpenLCD.Location = New System.Drawing.Point(16, 24) Me.ButtonOpenLCD.Name = "ButtonOpenLCD" Me.ButtonOpenLCD.Size = New System.Drawing.Size(320, 23) Me.ButtonOpenLCD.TabIndex = 0 Me.ButtonOpenLCD.Text = "Click Button To Open LCD Interface" ' 'ButtonDisplayBitmap ' Me.ButtonDisplayBitmap.Location = New System.Drawing.Point(16, 56) Me.ButtonDisplayBitmap.Name = "ButtonDisplayBitmap" Me.ButtonDisplayBitmap.Size = New System.Drawing.Size(320, 23) Me.ButtonDisplayBitmap.TabIndex = 1 Me.ButtonDisplayBitmap.Text = "Click Button To Display Bitmap On LCD" ' 'ButtonCloseLCD ' Me.ButtonCloseLCD.Location = New System.Drawing.Point(16, 120) Me.ButtonCloseLCD.Name = "ButtonCloseLCD" Me.ButtonCloseLCD.Size = New System.Drawing.Size(320, 23) Me.ButtonCloseLCD.TabIndex = 2 Me.ButtonCloseLCD.Text = "Click Button To Close LCD Interface" ' 'ButtonReadButtons ' Me.ButtonReadButtons.Location = New System.Drawing.Point(16, 88) Me.ButtonReadButtons.Name = "ButtonReadButtons" Me.ButtonReadButtons.Size = New System.Drawing.Size(256, 23) Me.ButtonReadButtons.TabIndex = 3 Me.ButtonReadButtons.Text = "Click Button To Read Soft Buttons" ' 'TextBoxButtons ' Me.TextBoxButtons.Enabled = False Me.TextBoxButtons.Location = New System.Drawing.Point(288, 88) Me.TextBoxButtons.Name = "TextBoxButtons" Me.TextBoxButtons.Size = New System.Drawing.Size(48, 20) Me.TextBoxButtons.TabIndex = 4 Me.TextBoxButtons.Text = "" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(352, 158) Me.Controls.Add(Me.TextBoxButtons) Me.Controls.Add(Me.ButtonReadButtons) Me.Controls.Add(Me.ButtonCloseLCD) Me.Controls.Add(Me.ButtonDisplayBitmap) Me.Controls.Add(Me.ButtonOpenLCD) Me.Name = "Form1" Me.Text = "Logitech G15 LCD Test Program" Me.ResumeLayout(False) End Sub #End Region Private Sub ButtonOpenLCD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonOpenLCD.Click Try modValue = 2 Dim applicationName As String = "CLDemo-VB" LCD.Open(applicationName, True) Catch excGeneric As Exception MessageBox.Show("Operation Failed - exception caught") End Try End Sub Private Sub ButtonDisplayBitmap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDisplayBitmap.Click Try bmp.hdr.Format = 1 ReDim bmp.pixels(LGLCD_SIZE) Dim I As Integer For I = 0 To 160 * 43 If ((I Mod modValue) = 0) Then bmp.pixels(I) = 128 Else bmp.pixels(I) = 0 End If Next I Dim priority As Long = LCDInterface.lglcd_PRIORITY_NORMAL LCD.DisplayBitmap(bmp.pixels(0), priority) ' toggle the number of strips on display If (modValue = 2) Then modValue = 4 Else modValue = 2 End If Catch excGeneric As Exception MessageBox.Show("Operation Failed - exception caught") End Try End Sub Private Sub ButtonCloseLCD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCloseLCD.Click Try modValue = 2 LCD.Close() Catch excGeneric As Exception MessageBox.Show("Operation Failed - exception caught") End Try End Sub Private Sub ButtonReadButtons_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonReadButtons.Click Try Dim buttons As System.Int64 LCD.ReadSoftButtons(buttons) TextBoxButtons.Text = buttons.ToString() Catch excGeneric As Exception MessageBox.Show("Operation Failed - exception caught") End Try End Sub End Class It would be Fantastic if anyone can help me =) And sry 4 my baaaaaa...aaad englsih but i'll learn it, promised! Mfg / Best Regards Spider www.AutoIt.de - Moderator of the German AutoIt Forum
Sypher Posted September 27, 2007 Posted September 27, 2007 Yes! This is the type of thing i want badly for a while now My C knowledge is not that good to convert it to AutoIT, but i really hope someone else can help us out!
Gigglestick Posted May 31, 2008 Posted May 31, 2008 Anyone ever find an answer to this? My UDFs: ExitCodes
Richard Robertson Posted June 1, 2008 Posted June 1, 2008 I think the answer is no. It's very likely that it will remain a no, as .Net and AutoIt are not compatible.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now