Thursday, April 19th 2018, 11:26pm UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

reshma.s

Beginner

Date of registration: Feb 27th 2018

Posts: 8

1

Wednesday, February 28th 2018, 8:00am

Keyboard in emwin with a background image

Hello , I need to create a keyboard with a background image . I habve used the keyboard.c available in this forum. But I need to customize each button and also add some extra customised buttons in the last row .Pls help

reshma.s

Beginner

Date of registration: Feb 27th 2018

Posts: 8

2

Wednesday, February 28th 2018, 9:06am

https://www.segger.com/cms/admin/uploads…ING_Notepad.zip am not able to get this link. Can youhelp me.

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 561

3

Wednesday, February 28th 2018, 10:37am

Hi,

Yes, we have changed our website and the link is no longer available.

I have attached the example.

Regards
Sven
SEGGER - Schoenen has attached the following file:

reshma.s

Beginner

Date of registration: Feb 27th 2018

Posts: 8

4

Wednesday, March 7th 2018, 11:07am

Thanks a lot!!!

reshma.s

Beginner

Date of registration: Feb 27th 2018

Posts: 8

5

Friday, March 16th 2018, 7:00am

Not able to return back

I created a keyboard using buttons.It uses a main window,an edit window and a dialog box for keyboard. After pressing enter it should return back with the text in the edit window. I tried using "deletewindow" but it wouldnt work. Please help.

This is my code portion handling keyboard

static void _cbKeybord(WM_MESSAGE * pMsg) {
GUI_RECT Rect;
WM_HWIN hItem;
WM_HWIN hParent;
int NCode;
int Id;
int i;
char c;
char acTextSrc[100 + 1];
char acTextDest[100 + 1];
int Len;


switch (pMsg->MsgId) {
case WM_INIT_DIALOG:

for (i = 0; i <= ID_BUTTON_34 - ID_BUTTON_0; i++) {

hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0 + i);


WM_SetCallback(hItem, _cbButton);
}
break;
case WM_PAINT:

GUI_SetBkColor(GUI_LIGHTGRAY);
GUI_Clear();
WM_GetClientRect(&Rect);
//GUI_DrawBitmap(&bmeditwindow,0,0);
GUI_DrawBitmap(&bmwindow,0,1);

break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(NCode) {
case WM_NOTIFICATION_RELEASED:

hParent = WM_GetParent(pMsg->hWin);

hItem = WM_GetDialogItem(hParent, ID_EDIT_0);

WM_SetFocus(hItem);
if (Id < ID_BUTTON_26) {

c = 'A' + (Id - ID_BUTTON_0);

GUI_StoreKeyMsg(c, 1);
GUI_StoreKeyMsg(c, 0);
}
else if (Id == ID_BUTTON_26) // back Space
{

EDIT_GetText(hItem, acTextSrc, sizeof(acTextSrc)); // Get
Len = strlen(acTextSrc);
if (Len > 0) {
acTextSrc[Len - 1] = '\0'; // Adapt
EDIT_SetText(hItem, acTextSrc); // Write back
}
}
else if (Id == ID_BUTTON_27) //Clr button - not needed at present
{
// EDIT_SetText(hItem, "");
}
else if (Id == ID_BUTTON_31) //Shift Key To do
{
_hKeyboard = GUI_CreateDialogBox(_aSmallBoardDialogCreate, GUI_COUNTOF(_aSmallBoardDialogCreate), _cbsmallbord, hWin, 0, 0);
// EDIT_SetText(hItem, "");
}
else if (Id == ID_BUTTON_30) //ABC Button - To do
{
start_keyboard = KEYPAD_NUM;
//GUI_ScreenKeypad_t211();
_hKeyboard = GUI_CreateDialogBox(_aNumBoardDialogCreate, GUI_COUNTOF(_aNumBoardDialogCreate), _cbNumbord, hWin, 0, 0);
}
else if (Id == ID_BUTTON_32) //Left Arrow Key
{
EDIT_AddKey(hItem,GUI_KEY_LEFT);
//EDIT_SetText(hItem, acTextSrc);
}
else if (Id == ID_BUTTON_33) //Right arrow key
{
EDIT_AddKey(hItem,GUI_KEY_RIGHT);
}
else if (Id == ID_BUTTON_34) //Enter Button
{

EDIT_GetText(hItem, acTextSrc, sizeof(acTextSrc));
memcpy(UserOrpass,acTextSrc,sizeof(acTextSrc));
enter_pressed = 1;
WM_DeleteWindow(pMsg->hWin);

}
else if (Id == ID_BUTTON_28)
{ // Space button
c = ' '; // Same as other characters
GUI_StoreKeyMsg(c, 1);
GUI_StoreKeyMsg(c, 0);

}
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}

This post has been edited 3 times, last edit by "reshma.s" (Mar 16th 2018, 7:04am)