Comments (15)
Does that happen with normal TextField? If so then this is a libGDX issue.
from vis-ui.
No, only with VisTextField.
from vis-ui.
Ok then, will take a look.
from vis-ui.
Also, could you post SSCCE, please?
from vis-ui.
I cannot reproduce with this:
public class TestIssue50 {
public static void main (String[] args) {
LwjglApplicationConfiguration c = new LwjglApplicationConfiguration();
c.width = 1280;
c.height = 720;
new LwjglApplication(new TestIssue50Application(), c);
}
}
class TestIssue50Application extends ApplicationAdapter {
private Stage stage;
@Override
public void create () {
VisUI.load();
stage = new Stage(new ScreenViewport());
Table table = new Table();
table.setFillParent(true);
table.add(getNewVisTextField()).row();
table.add(getNewGdxTextField()).row();
stage.addActor(table);
Gdx.input.setInputProcessor(new InputMultiplexer(stage, new TestInputProcessor()));
}
private VisTextField getNewVisTextField () {
return new VisTextField("VisTextField");
}
private TextField getNewGdxTextField () {
TextFieldStyle style = new TextFieldStyle(VisUI.getSkin().get(TextFieldStyle.class));
return new TextField("GdxTextField", style);
}
@Override
public void resize (int width, int height) {
stage.getViewport().update(width, height, true);
}
@Override
public void render () {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
stage.act(Gdx.graphics.getDeltaTime());
stage.draw();
}
@Override
public void dispose () {
VisUI.dispose();
stage.dispose();
}
class TestInputProcessor extends InputAdapter {
@Override
public boolean keyDown (int keycode) {
System.out.println("PROCESSED, KEYCODE:" + keycode);
return false;
}
}
}
from vis-ui.
I've just tried to experiment a bit and I found out that I can get the behaviour I described only if VisTextField is an actor inside a Node in a Tree (or VisTree, doesn't matter). libgdx TextField doesn't have this issue in the same conditons though.
from vis-ui.
Please provide a SSCCE.
from vis-ui.
public class TestIssue50 {
public static void main (String[] args) {
LwjglApplicationConfiguration c = new LwjglApplicationConfiguration();
c.width = 1280;
c.height = 720;
new LwjglApplication(new TestIssue50Application(), c);
}
}
class TestIssue50Application extends ApplicationAdapter {
private Stage stage;
@Override
public void create () {
VisUI.load();
stage = new Stage(new ScreenViewport());
Table table = new Table();
table.setFillParent(true);
VisTree tree = new VisTree();
table.add(tree);
tree.add(new Node(getNewVisTextField()));
tree.add(new Node(getNewGdxTextField()));
stage.addActor(table);
Gdx.input.setInputProcessor(new InputMultiplexer(stage, new TestInputProcessor()));
}
private VisTextField getNewVisTextField () {
return new VisTextField("VisTextField");
}
private TextField getNewGdxTextField () {
TextFieldStyle style = new TextFieldStyle(VisUI.getSkin().get(TextFieldStyle.class));
return new TextField("GdxTextField", style);
}
@Override
public void resize (int width, int height) {
stage.getViewport().update(width, height, true);
}
@Override
public void render () {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
stage.act(Gdx.graphics.getDeltaTime());
stage.draw();
}
@Override
public void dispose () {
VisUI.dispose();
stage.dispose();
}
class TestInputProcessor extends InputAdapter {
@Override
public boolean keyDown (int keycode) {
System.out.println("PROCESSED, KEYCODE:" + keycode);
return false;
}
}
}
from vis-ui.
Which VisUI version do you use?
from vis-ui.
VisUI 0.9.1 and libGDX 1.7.0
from vis-ui.
I got another interesting behaviour. When I use VisTextField after clicking on some button my game starts getting input again but only keyDown events, not keyUp. When I use TextField I just can't get any key events anymore. Btw it's not Tree issue, it can be reproduced anywhere.
from vis-ui.
Should work now.
from vis-ui.
After I call VisTextField.focusLost()
I still can get only keyDown events. I can get keyUp only after I press some button. You should add FocusManager.getFocus(getStage());
in focusLost()
.
from vis-ui.
That's not how it works, focusLost
and focusGained
are listener methods called by FocusManager
.
You never manually call them.
To take focus you need to call FocusManager.getFocus(stage)
or stage.setKeyboardFocus(null)
(but the second way would left focus border still visible on widget)
from vis-ui.
Makes sense now, thanks!
from vis-ui.
Related Issues (20)
- Tab and ScrollPane visual bug HOT 3
- IllegalArgumentException application crash when typing name in FileChooser "Open" dialog HOT 2
- Update to LibGDX 1.9.14 HOT 1
- VisUI Tixel Skin, where'd it go? HOT 3
- VisImageButton getImage().setColor(color) does not work. HOT 4
- VisUI Draggable on Grid HOT 3
- Add rich text HOT 2
- Tree node is removed but the container remains HOT 3
- Build issue default startup LibGDX project with GWT and VisUI HOT 3
- Tooltip Issue HOT 3
- Illegal reflective access operation with FileChooser
- Enhance VisWindow HOT 2
- Window close should have an close callback listener HOT 1
- [VisUI Request] Set text orientation in VisImageTextButton HOT 1
- Support 'center' alignments in ToastManager
- TabbedPane clicking a tab makes it invisible HOT 3
- VisUI 1.5.2 release HOT 2
- VisUI 1.5.3 release
- Some enhanced suggestions
- How to render? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vis-ui.