Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] StyledText and keyboard actions

Hi Gunnar,

Thanks again for the help, I've change our shortcut handling with your suggested one and it seems to work fine.

Can you explain why? Maybe it helps explaining what you are trying to implement. As for the documented contract it seems correct.

I thought each handled KeyDown event had to be marked as .doit = false, so additional KeyDown listeners (or display filters) know whether it already has been processed and can ignore it. But I have an (ugly) work-around for that, so it's no need for me.

--
Best regards,
Thomas Singer
=============
syntevo GmbH
http://www.syntevo.com
http://www.syntevo.com/blog


On 03.02.2017 14:44, Gunnar Wagenknecht wrote:
On 3 Feb 2017, at 13:50, Thomas Singer <ts-swt@xxxxxxxxxxx> wrote:

	Event verifyEvent = new Event();
...
	verifyEvent.doit = event.doit;

	notifyListeners(ST.VerifyKey, verifyEvent);
	if (verifyEvent.doit) {

The problem is that if the VerifyKey-listener has set verifyEvent.doit to false, this change is NOT propageted to the KeyDown listener, so if there is one more KeyDown listener, it will not know whether the event already has been processed. Looks like a bug to me.

Can you explain why? Maybe it helps explaining what you are trying to implement. As for the documented contract it seems correct. A VerifyKeyListener can block an event from being handled. If doit is false then other key down listeners should not be informed.

Thank you for the suggestion. In what repository I can find the AbstractTextEditor (I'm only used to SWT)? Thanks in advance.


It's here:
http://git.eclipse.org/c/platform/eclipse.platform.text.git/tree/ <http://git.eclipse.org/c/platform/eclipse.platform.text.git/tree/>

-Gunnar



_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top