Tuesday, October 17th 2017, 7:59am 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.

akiramaru

Beginner

Date of registration: Oct 3rd 2017

Posts: 3

1

Thursday, October 5th 2017, 7:10am

How to get GUI_SendKeyMsg event when I focused at EDIT widget?

Dear all:
Here has a problem when I focused on an EDIT widget, I can't get any KeyMsg when I press button and sent to the queue. Have anybody can help me to solve this problem, thx.

P.S. Myapplication for STemWin is only use keyboard not touch screen.

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
switch(Id) {
	case ID_EDIT_0: // Notifications sent by 'Edit'
	switch(NCode) {
		case WM_NOTIFICATION_CLICKED:
			// USER START (Optionally insert code for reacting on notification message)
			// USER END
		break;
		case WM_NOTIFICATION_RELEASED:
			// USER START (Optionally insert code for reacting on notification message)
			// USER END
		break;
		case WM_NOTIFICATION_VALUE_CHANGED:
			// USER START (Optionally insert code for reacting on notification message)
			// USER END
		break;
	// USER START (Optionally insert additional code for further notification handling)
	// USER END
	}
	break; }

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 379

2

Friday, October 6th 2017, 2:45pm

Hi,

Unfortunately, you can not react on key messages like you react on e.g. value changed. To react on key messages you have to set a custom callback for the edit widget itself.

Attached you will find a short example on how this can be done. It shows the custom callback and how to distinguish between the different keys.

Regards
Sven
SEGGER - Schoenen has attached the following file:
  • KeyMsg.zip (1.08 kB - 12 times downloaded - Last download: Yesterday, 3:03pm)

akiramaru

Beginner

Date of registration: Oct 3rd 2017

Posts: 3

3

Wednesday, October 11th 2017, 7:38am

Dear Sir:
Thanks for your support, I am try to learn it. :thumbup:

akiramaru

Beginner

Date of registration: Oct 3rd 2017

Posts: 3

4

Thursday, October 12th 2017, 8:51am

Dear Sir:
I have tried your code but it doesn't work well, please see attach pic. I set my BUTTON_ENTER value is 0x81A but i got KeyMsg on _cbEDIT0 is 0x10000000 they are doesn't match, could you solve these problem? Thanks.
Hi,

Unfortunately, you can not react on key messages like you react on e.g. value changed. To react on key messages you have to set a custom callback for the edit widget itself.

Attached you will find a short example on how this can be done. It shows the custom callback and how to distinguish between the different keys.

Regards
Sven
akiramaru has attached the following image:
  • keymsg.png

Similar threads