mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8166772: Touch keyboard is not shown for text components on a screen touch
Reviewed-by: serb, azvegint
This commit is contained in:
parent
a9cb8eb350
commit
dd41b7691f
24 changed files with 726 additions and 13 deletions
|
@ -33,6 +33,8 @@ import java.io.IOException;
|
|||
import java.io.ObjectInputStream;
|
||||
import java.awt.IllegalComponentStateException;
|
||||
import java.awt.MouseInfo;
|
||||
|
||||
import sun.awt.AWTAccessor;
|
||||
import sun.awt.SunToolkit;
|
||||
|
||||
/**
|
||||
|
@ -331,6 +333,11 @@ public class MouseEvent extends InputEvent {
|
|||
*/
|
||||
int clickCount;
|
||||
|
||||
/**
|
||||
* Indicates whether the event is a result of a touch event.
|
||||
*/
|
||||
private boolean causedByTouchEvent;
|
||||
|
||||
/**
|
||||
* Indicates which, if any, of the mouse buttons has changed state.
|
||||
*
|
||||
|
@ -399,6 +406,17 @@ public class MouseEvent extends InputEvent {
|
|||
//whatever besides SunToolkit) could also operate.
|
||||
cachedNumberOfButtons = 3;
|
||||
}
|
||||
AWTAccessor.setMouseEventAccessor(
|
||||
new AWTAccessor.MouseEventAccessor() {
|
||||
public boolean isCausedByTouchEvent(MouseEvent ev) {
|
||||
return ev.causedByTouchEvent;
|
||||
}
|
||||
|
||||
public void setCausedByTouchEvent(MouseEvent ev,
|
||||
boolean causedByTouchEvent) {
|
||||
ev.causedByTouchEvent = causedByTouchEvent;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue