Comments (3)
Yeah, this would be great. In the original Defender's Quest, you could navigate the entire screen using the keyboard, via both Tabs to jump from button to button, as well as a "virtual mouse" that let you move with the arrow keys and click with enter (or any custom settings you wanted).
So this sort of framework should definitely be added.
from flixel-ui.
I need to understand how input works in general for Flixel, so this isn't final, but here's what I'm thinking so far:
flixel.addons.ui.FlxInputManager
FlxInputManager accepts a settings file from the user, and creates bindings for various input events.
Input events:
- Virtual Mouse Click (a button press or anything else that counts as a mouse click)
- Virtual Mouse Movement (keypress or anything that should move the mouse cursor)
- Tab jump forward (keypress or anything, tab by default, that jumps mouse cursor to next clickable thing)
- Tab jump backward (same as above, but opposite direction)
- User defined hotkeys (broadcasts generic signals to active FlxUI objects)
FlxUI will automatically package together all clickable elements on the screen into an array, perhaps "tab_list." By default it will add items from top left to bottom right, as well as adding individual elements by group and/or hierarchy (so all the elements of a radio button group come one after another).
When FlxUI receives the "tab jump forward/backward" signal it will move the mouse cursor to the "center" of the next/previous object in tab_list.
(Is it possible to force the mouse to move to an arbitrary position?)
FlxInputManager will have some other things to do:
--If "virtual mouse" is enabled, listen for virtual mouse movement, and if present, move the mouse cursor.
--(Do same for clicking, and find way to emulate a true mouse click at a low level).
I'll start by making this work with keyboard commands, and then we can expand to make it work for gamepads. If we're truly ambitious, the framework could support things like mouse/touch gestures, but let's not get crazy just yet.
from flixel-ui.
I have basically done almost everything you mentioned here with FlxUICursor. It could be improved/extended upon, but I think we should open new issues for specific wish-list stuff, the main thrust of this is now done.
See this demo:
https://github.com/HaxeFlixel/flixel-demos/tree/dev/User%20Interface/Cursor
from flixel-ui.
Related Issues (20)
- FlxInputText on JS crashes with when trying to make text go multiline HOT 4
- FlxUITabMenu not working HOT 2
- Unable to backspace last character on JS target in FlxInputText and FlxUIInputText HOT 1
- XML Issues HOT 7
- Suggestion: XML Schema for UI format
- FlxUICursor: Potential typo warning from Haxe
- Potential typo detected (expected similar values are flixel.addons.ui.SortMethod.ID)
- FlxInputText is not getting focus HOT 2
- Space doesn't work on FlxInputText in html5 HOT 4
- FlxInputText caret does not got below first line
- idk what is this but is from psych engine 0.7.1h source code compile HOT 1
- Chromium browsers on Android only shows numeric input
- FlxUIButton creates incrementally larger graphic keys
- FlxSlider / FlxUISlider hitbox issue HOT 1
- QUESTION: Haxe Version HOT 2
- [BUG] FlxUIDropDownMenu not working correctly HOT 7
- Missing documentation on FlxUICheckBox's and FlxUITabMenu's "new" functions.
- How to make an slider? HOT 5
- Better errors when using flixel-addons classes
- Rendering artifacts are shown when an flxsprite's angle is not 0 or 180 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 flixel-ui.