NAME
LCD SDK
COPYRIGHT
The Logitech LCD SDK, including all accompanying documentation, is protected by intellectual property laws. All rights not expressly granted by Logitech are reserved.
PURPOSE
The LCD SDK is aimed at developers wanting to make use of the LCD
display on Logitech G-series keyboard. It comes with a very
intuitive and easy to use interface which enables one to easily
display static strings, scrolling strings, progress bars, icons
and bitmaps.
See the following to get started:
- readme.txt: Describes how to get started
- Use one of the samples included to see how things work.
AUTHOR
Christophe Juncker (cj@wingmanteam.com)
CREATION DATE
06/13/2005
MODIFICATION HISTORY
04/25/2011 - Fixed animated bitmap bug. Updated documentation.
06/26/2009 - Renamed to LCD SDK. Fixed SetPriority bug that would
happen when using mode other than dual.
09/24/2008 - Added support for color display.
04/30/2007 - Added string safe function "LCDUI_tcscpy", See
LCDBase.h for macro definition.
03/01/2006 - Added the concept of pages to the API. A client can
now have multiple pages, each with its own
controls. A page can be shown, while another is
modified.
11/17/2006 - Added extra AddBitmap(...) method with width and
height parameters. Added GetCurrentPageNumber()
method.
NAME
CEzLcd() -- Basic constructor. The user must call the InitYourself(...) method after calling this constructor.
FUNCTION
Object is created.
NAME
CEzLcd(LPCTSTR friendlyName) -- Constructor.
FUNCTION
Does necessary initialization. If you are calling this constructor, then you should NOT call the InitYourself(...) method.
INPUTS
friendlyName - friendly name of the applet/game. This name will be
displayed in the Logitech G-series LCD Manager.
NAME
HRESULT Initialize(LPCTSTR friendlyName, AppletSupportType supportType, BOOL isAutoStartable = FALSE, BOOL isPersistent = FALSE, lgLcdConfigureContext* configContext = NULL, lgLcdNotificationContext* notificationContext = NULL, lgLcdSoftbuttonsChangedContext* softbuttonChangedContext = NULL)
FUNCTION
Does necessary initialization. This method SHOULD ONLY be called if the empty constructor is used: CEzLcd().
INPUTS
friendlyName - friendly name of the applet/game. This name will be
displayed in the Logitech G-series LCD Manager.
supportType - What type of displays the applet supports. Options
are:
- LG_MONOCHROME_MODE_ONLY
- LG_COLOR_MODE_ONLY
- LG_DUAL_MODE
IsAutoStartable - Determines if the applet is to be started
automatically every time by the LCD manager software
(Part of G15 software package).
IsPersistent - Determines if the applet's friendlyName will remain
in the list of applets seen by the LCD manager
software after the applet terminates.
configContext - Pointer to the lgLcdConfigContext structure used
during callback into the applet.
softbuttonChangedContext - softbutton callback (if the user does
not want to use LCD SDK's native handler).
RETURN VALUE
S_OK if it can connect to the LCD Manager. E_FAIL otherwise.
NAME
BOOL IsDeviceAvailable(DisplayType type) -- Check if a device of specified type is available.
INPUTS
type - type of the device. Possible values are:
- LG_MONOCHROME
- LG_COLOR
RETURN VALUE
TRUE if available FALSE otherwise.
NAME
VOID ModifyDisplay(DisplayType type) -- Define whether to modify color or monochrome display.
NOTES
If programming support for both color and monochrome displays (LG_DUAL_MODE), this function needs to be called every time before calling a function or a set of functions for one of the displays.
INPUTS
type - type of the display. Possible values are:
- LG_MONOCHROME
- LG_COLOR
NAME
INT AddNewPage() -- Call this method to create a new page to be displayed on the LCD.
RETURN VALUE
Current number of pages, after the page is added.
NAME
INT RemovePage(INT pageNumber) -- Call this method to remove a page from the pages you've created to be displayed on the LCD.
INPUTS
pageNumber - The number for the page that is to be removed.
RETURN VALUE
Current number of pages, after the page is removed.
NAME
INT GetPageCount() -- Returns the current number of pages.
RETURN VALUE
Current number of pages.
NAME
INT AddNumberOfPages(INT numberOfPages) -- Adds numberOfPages to the total of pages you've created.
INPUTS
numberOfPages - Count of pages to add in.
RETURN VALUE
Current number of pages, after the pages are added.
NAME
HRESULT ModifyControlsOnPage(INT pageNumber) -- Call this method in order to modify the controls on specified page.
NOTES
This method must be called first prior to any modifications on that page.
INPUTS
pageNumber - The page number that the controls will be modified on.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT ShowPage(INT pageNumber) -- Call this method in order to make the page shown on the LCD.
INPUTS
pageNumber - The page that will be shown among your pages on the LCD.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
INT GetCurrentPageNumber() -- Get page number currently being displayed.
RETURN VALUE
Number of page currently being displayed. First page is number 0.
NAME
VOID SetBackground(HBITMAP bitmap) - Use a bitmap as a background.
NOTES
To be used for color display only.
INPUTS
bitmap - handle to the bitmap to be used.
NAME
VOID SetBackground(COLORREF color) - Use a color as a background.
NOTES
To be used for color display only.
INPUTS
color - color to set the background.
NAME
HANDLE AddText(LGObjectType type, LGTextSize size, INT alignment, INT maxLengthPixels, INT numberOfLines = 1, fontWeight = FW_DONTCARE) -- Add a text object to the page being worked on.
INPUTS
type - specifies whether the text is static or
scrolling. Possible types are:
- LG_SCROLLING_TEXT
- LG_STATIC_TEXT
size - size of the text. Can be any of the following:
- LG_TINY (color display only)
- LG_SMALL
- LG_MEDIUM
- LG_BIG
alignment - alignment of the text. Can be any of the following:
- DT_LEFT
- DT_CENTER
- DT_RIGHT
maxLengthPixels - max length in pixels of the text. If the text is
longer and of type LG_STATIC_TEXT, it will be cut
off. If the text is longer and of type
LG_SCROLLING_TEXT, it will scroll.
numberOfLines - number of lines the text can use. For static text
only. If number bigger than 1 and static text is
too long to fit on LCD, the text will be displayed
on multiple lines as necessary.
fontWeight - weight of the font. Options are:
- FW_DONTCARE, FW_THIN, FW_EXTRALIGHT, FW_LIGHT,
FW_NORMAL,FW_MEDIUM, FW_SEMIBOLD, FW_BOLD,
FW_EXTRABOLD, FW_HEAVY
RETURN VALUE
Handle for this object.
SEE ALSO
AddIcon(HICON.hIcon,INT.sizeX,INT.sizeY) AddProgressBar(LGProgressBarType.type)
NAME
HRESULT SetText(HANDLE handle, LPCTSTR text, BOOL resetScrollingTextPosition = FALSE) -- Sets the text in the control on the page being worked on.
INPUTS
handle - handle to the object.
text - text string.
resetScrollingTextPosition - indicates if position of scrolling
text needs to be reset.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetTextBackground(HANDLE handle, INT backMode, COLORREF color=RGB(0,0,0)) -- Set whether the background is opaque or transparent, and if opaque, set the color.
NOTES
To be used for color display only.
INPUTS
handle - handle to the object. backMode - OPAQUE or TRANSPARENT. color - color to set an opaque background.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetTextFontColor(HANDLE handle, COLORREF color) -- Sets the color of the text.
NOTES
To be used for color display only.
INPUTS
handle - handle to the object. color - color to set the text.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HANDLE AddIcon(HICON hIcon, INT sizeX, INT sizeY) -- Add an icon object to the page being worked on.
INPUTS
hIcon - icon to be displayed on the page. Should be 1 bpp bitmap. sizeX - x axis size of the bitmap. sizeY - y axis size of the bitmap.
RETURN VALUE
Handle for this object.
SEE ALSO
AddText(LGObjectType.type,LGTextSize.size,INT.alignment,INT.maxLengthPixels,INT.numberOfLines,LONG.fontWeight) AddProgressBar(LGProgressBarType.type)
NAME
HANDLE AddProgressBar(LGProgressBarType type) -- Add a progress bar object to the page being worked on.
INPUTS
type - type of the progress bar. Types are:
- LG_CURSOR, LG_FILLED, LG_DOT_CURSOR.
RETURN VALUE
Handle for this object.
SEE ALSO
AddText(LGObjectType.type,LGTextSize.size,INT.alignment,INT.maxLengthPixels,INT.numberOfLines,LONG.fontWeight) AddIcon(HICON.hIcon,INT.sizeX,INT.sizeY)
NAME
HRESULT SetProgressBarPosition(HANDLE handle, FLOAT percentage) -- Set position of the progress bar's cursor.
INPUTS
handle - handle to the object. percentage - percentage of progress (0 to 100).
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetProgressBarSize(HANDLE handle, INT width, INT height) -- Set size of progress bar.
INPUTS
handle - handle to the object. width - x axis part of the size. height - y axis part of the size (a good default value is 5).
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetProgressBarColors(HANDLE handle, COLORREF cursorColor, COLORREF borderColor) -- For color only. Set the color of the progress bar.
INPUTS
handle - handle to the object. cursorColor - color to set the cursor. borderColor - color to set the border.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetProgressBarBackgroundColor(HANDLE handle, COLORREF color) -- For color only. Set the backgroundcolor of the progress bar.
INPUTS
handle - handle to the object. color - color to set the background.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HANDLE AddAnimatedBitmap(HBITMAP bitmap, INT subpicWidth, INT height) -- Creates an Animated Bitmap. The bitmap must be composed of framestrips with constant dimensions. The framestrips must be aligned in the x axis
INPUTS
bitmap - the HBITMAP of the bitmap subpicWidth - width of 1 framestrip
RETURN VALUE
HANDLE of the Animated Bitmap if succeeded. NULL otherwise.
NAME
HRESULT SetAnimatedBitmap(HANDLE handle,INT msPerPic) -- Set options to the animated bitmap
INPUTS
handle - the HANDLE of the animated bitmap msPerPic - frame rate (milliseconds per frame)
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HANDLE AddSkinnedProgressBar(LGProgressBarType type) -- Add a skinned progress bar.
NOTES
To be used for color display only.
INPUTS
type - type of the progress bar. Types are: LG_CURSOR, LG_FILLED.
RETURN VALUE
Handle for this object.
NAME
HRESULT SetSkinnedProgressBarBackground(HANDLE handle, HBITMAP background, INT width, INT height) -- Sets the background bitmap of the progress bar. Width and height will set the size of the progress bar.
INPUTS
handle - Handle to the progress bar. background - Handle to the bitmap to display. width, height - Size of the image, and therefore the progress bar.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetSkinnedProgressBarFiller(HANDLE handle, HBITMAP filler, INT width, INT height) -- Sets the filler bitmap of the progress bar, which needs to be the same size as the background.
INPUTS
handle - Handle to the progress bar.
filler - Handle to the bitmap to display as the filler.
width, height - Size of the image (needs to be the same size as
background).
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetSkinnedProgressBarCursor(HANDLE handle, HBITMAP cursor, INT width, INT height) -- Sets the cursor bitmap of the progress bar. Height needs to be the same as the background.
INPUTS
handle - Handle to the progress bar.
filler - Handle to the bitmap to display as the cursor.
width, height - Size of the image (height needs to be the same
size as background).
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetSkinnedProgressBarThreePieceCursor(HANDLE handle, HBITMAP left, INT bmpLeftWidth, INT bmpLeftHeight, HBITMAP mid, INT bmpMidWidth, INT bmpMidHeight, HBITMAP right, INT bmpRightWidth, INT bmpRightHeight) -- Sets the cursor of the progress bar if it is in 3 pieces. This is a special case -- this is the case where the cursor needs to have left, middle, and right sections, such as curved edges.
INPUTS
handle - Handle to the progress bar. left, mid, right - Handles to the bitmaps to display as the cursor. widths, heights - Size of the images.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetSkinnedProgressHighlight(HANDLE handle, HBITMAP highlight, INT width, INT height) -- Sets the highlight bitmap of the progress bar. Optional.
INPUTS
handle - Handle to the progress bar. highlight - Handle to the bitmap to display as the highlight. width, height - Size of the image.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HANDLE AddBitmap(INT width, INT height) -- Add a bitmap object to the page being worked on.
INPUTS
width - width of the invisible box around the bitmap. height - height of the invisible box around the bitmap.
RETURN VALUE
Handle for this object.
NOTES
The width and height parameters define an invisible box that is around the bitmap, starting at the upper left corner. If for example a bitmap is 32x32 pixels and the width and height parameters given are 10x10, only the 10 first pixels of the bitmap will be displayed both in width and height.
SEE ALSO
AddText(LGObjectType.type,LGTextSize.size,INT.alignment,INT.maxLengthPixels,INT.numberOfLines,LONG.fontWeight) AddIcon(HICON.hIcon,INT.sizeX,INT.sizeY)
NAME
HRESULT SetBitmap(HANDLE handle, HBITMAP bitmap) -- Set the bitmap.
INPUTS
handle - handle to the object.
bitmap - handle to the bitmap to be set. Needs to be 1bpp for
monochrome display.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetOrigin(HANDLE handle, INT XOrigin, INT YOrigin) -- Set the origin of an object. The origin corresponds to the furthest pixel on the upper left corner of an object.
INPUTS
handle - handle to the object. XOrigin - x axis part of the origin. YOrigin - y axis part of the origin.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetVisible(HANDLE handle, BOOL visible) -- Set corresponding object to be visible or invisible on the page being worked on.
INPUTS
handle - handle to the object.
visible - set to FALSE to make object invisible, TRUE to make it
visible (default).
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetAsForeground(BOOL setAsForeground) -- Become foreground applet on LCD, or remove yourself as foreground applet.
INPUTS
setAsForeground - Determines whether to be foreground or not.
Possible values are:
- TRUE implies foreground
- FALSE implies no longer foreground
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
HRESULT SetScreenPriority(DWORD priority) -- Set screen priority.
INPUTS
priority - priority of the screen. Possible values are:
- LGLCD_PRIORITY_IDLE_NO_SHOW
- LGLCD_PRIORITY_BACKGROUND
- LGLCD_PRIORITY_NORMAL
- LGLCD_PRIORITY_ALERT.
NOTES
Default priority is LGLCD_PRIORITY_NORMAL. If setting to LGLCD_PRIORITY_ALERT for too long, applet will be shut out by applet manager.
RETURN VALUE
S_OK if succeeded. E_FAIL otherwise.
NAME
DWORD GetScreenPriority() -- Get screen priority.
RETURN VALUE
One of the following:
- LGLCD_PRIORITY_IDLE_NO_SHOW
- LGLCD_PRIORITY_BACKGROUND
- LGLCD_PRIORITY_NORMAL
- LGLCD_PRIORITY_ALERT
NAME
BOOL ButtonTriggered(INT button) -- Check if a button was triggered.
INPUTS
button - name of the button to be checked. Possible names are:
- monochrome display: LG_BUTTON_1, LG_BUTTON_2, LG_BUTTON_3,
LG_BUTTON_4.
- color display: LG_BUTTON_LEFT, LG_BUTTON_RIGHT, LG_BUTTON_UP,
LG_BUTTON_DOWN, LG_BUTTON_OK, LG_BUTTON_CANCEL,
LG_BUTTON_MENU.
RETURN VALUE
TRUE if the specific button was triggered. FALSE otherwise.
SEE ALSO
ButtonReleased(INT.button) ButtonIsPressed(INT.button)
NAME
BOOL ButtonReleased(INT button) -- Check if a button was released.
INPUTS
button - name of the button to be checked. Possible names are:
- monochrome display: LG_BUTTON_1, LG_BUTTON_2, LG_BUTTON_3,
LG_BUTTON_4.
- color display: LG_BUTTON_LEFT, LG_BUTTON_RIGHT, LG_BUTTON_UP,
LG_BUTTON_DOWN, LG_BUTTON_OK, LG_BUTTON_CANCEL,
LG_BUTTON_MENU.
RETURN VALUE
TRUE if the specific button was released. FALSE otherwise.
SEE ALSO
ButtonTriggered(INT.button) ButtonIsPressed(INT.button)
NAME
BOOL ButtonIsPressed(INT button) -- Check if a button is being pressed.
INPUTS
button - name of the button to be checked. Possible names are:
- monochrome display: LG_BUTTON_1, LG_BUTTON_2, LG_BUTTON_3,
LG_BUTTON_4.
- color display: LG_BUTTON_LEFT, LG_BUTTON_RIGHT, LG_BUTTON_UP,
LG_BUTTON_DOWN, LG_BUTTON_OK, LG_BUTTON_CANCEL,
LG_BUTTON_MENU.
RETURN VALUE
TRUE if the specific button is being pressed. FALSE otherwise.
SEE ALSO
ButtonTriggered(INT.button) ButtonReleased(INT.button)
NAME
BOOL AnyDeviceOfThisFamilyPresent(DWORD deviceFamily)
NOTES
This function is no longer supported.
NAME
HRESULT SetDeviceFamilyToUse(DWORD deviceFamily)
NOTES
This function is no longer supported.
NAME
HRESULT SetPreferredDisplayFamily(DWORD deviceFamily)
NOTES
This function is no longer supported.
NAME
VOID Update() -- Update LCD display.
FUNCTION
Updates the display. Must be called every loop.