Comments (2)
@joshtynjala We found a solution that works for buttons and allows inputs to work too:
this._starling.nativeStage.addEventListener(KeyboardEvent.KEY_DOWN, disableSpaceKey, true, 1);
//....
protected function disableSpaceKey(event:KeyboardEvent):void
{
if(FocusManager.focus is Button && event.keyCode == Keyboard.SPACE)
{
event.preventDefault();
event.stopPropagation();
event.stopImmediatePropagation();
}
}
However, it seams a bit radical.
Setting FocusManager.focus = null
on all trigger events also works, but seams wrong.
Since keyToTrigger
is protected, extending all buttons may also work, but is a lot of work.
In the future we might want to add full keyboard navigation.
Any other suggestion is more than welcomed. Thanks.
from feathersui-starling.
If space is triggering a button, it's because the button has focus. If you're using the FocusManager
, you can clear the focus with FocusManager.focus = null
at any time. If you're not using the FocusManager
, then set stage.focus = null
(or stage.focus = stage
may be better sometimes) to clear focus.
If you're using the FocusManager
, and you have a custom object that needs to receive focus, you can have it implement IFocusDisplayObject
.
from feathersui-starling.
Related Issues (20)
- how to creat Vertica TextBlockTextRenderer? HOT 4
- Hidden rendering bug
- Null Object Reference when removing feathers control while parent is added to stage HOT 1
- BottomDrawerPopUpContentManager ignored panel.headerFactory
- Callout at borderline forgets to override arrowSkin
- LayoutGroup visible property HOT 11
- Is that a way to position the 'Toast' on top? HOT 1
- SoundChannelPeakVisualizer Implementation HOT 2
- VideoPlayer and screen rotation. HOT 2
- Error #1009 on Scroller/focusOutHandler HOT 2
- Default scale factor of MetalWorksDesktopTheme? HOT 1
- SDK Manager HOT 1
- TextInput width changes from focus in / focus out - Android Only HOT 8
- extending the Label class HOT 4
- Object not removed from Stage on Android - Starling maybe? HOT 1
- VerticalLayout without virtual layout throws error on drag/drop HOT 2
- TextInput promptTextRenderer has no stateContext added
- Getting quite a few of these 3768 HOT 4
- Possible minor tweening issue in `BaseEffectContext` @ `playReverse()` HOT 2
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 feathersui-starling.