|
|
|
|
Re: Posting event from linux doesn't work like with windows [message #1716338 is a reply to message #1716292] |
Thu, 03 December 2015 01:24   |
Eclipse User |
|
|
|
Hzllo Brian
thanks again for your help
I effectivily send two posts event, one with KeyDown, one with KeyUp
look....if I use that code in the same shell than the widget it works
public void KeyboardEvent(Browser TheBrowser, Event Theevent){
TheBrowser.setFocus();
TheBrowser.getDisplay().post(Theevent);
System.out.println("KeyEvent"+Theevent);
}
Button btnZoom_1 = new Button(compositeButtons, SWT.NONE);
btnZoom_1.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
Event MyEvent = new Event();
MyEvent.type = SWT.KeyDown;
MyEvent.keyCode = 0x40000;
KeyboardEvent(MyBrowser,MyEvent);
MyEvent.type = SWT.KeyDown;
MyEvent.keyCode = 0x100002d;
KeyboardEvent(MyBrowser,MyEvent);
MyEvent.type = SWT.KeyUp;
KeyboardEvent(MyBrowser,MyEvent);
MyEvent.type = SWT.KeyUp;
MyEvent.keyCode = 0x40000;
KeyboardEvent(MyBrowser,MyEvent);
}
});
btnZoom_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
btnZoom_1.setText("Zoom-");
There is 4 event because it's a combinaison of CONTROL and ADD
Now I put that code into a child shell and the widget's event fires only 1 of 10
I believe you that it works but I have no idea why it works only 1 of 10.
Maybe Linux can't handle events coming from child shells?
This would kill my project 
Have a nice day
Nicolas
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 1.18172 seconds