-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard / Controller Support? #323
Comments
Before anything else, have you looked into using a system like Synergy + usynergy.c to have your game console use your PC mouse/keyboard ? I'd wholly recommend that.
Not sure what you mean by "the update loop" nor why you would need that if you are spoofing mouse control? If you are going to spoof mouse control just make your controller adjust the MousePos and MouseDown (buttons) values. You can call
No it's not available yet, there's no generalized concept of focus in fact. Now if you really want controller support. There's different way we can approach this:
I have rename your topic to keyboard/controller because the problems are the same for keyboard controls and many people are likely to come from the angle of desiring keyboard control. |
Yeah, we've got this up and running (except for keyboard support, since I've yet to hook up the manual character-input stuff). We want to add controller as a good native option, so users don't have to switch input devices.
Apologies; I meant that we could do something like move the mouse down "an item" instead, but that starts to get a bit complicated for client code, especially since we'd need this to be something for everyone to use, to make their own debug GUIs. With that approach, we'd need the screen-rect of the options etc.
Yeah, this is looking to be the only option in the timeframe we're looking at. Since we also have Synergy, I'm not convinced adding this is worth it; I know I'd easily switch to mouse + keys as soon as I had to, rather than bear analog-stick mouse cursor!
Certainly! But getting it to reflect in the UI is the tricky bit =/
Hmm, I'll be honest: I'm so accustomed to working with closed-source things that simply adding the feature to ImGUI didn't occur to me. I think it's a little out of scope for the timeframe I have, but it's certainly worth considering in the longer term, should we find that controller support is indispensable for whatever reason.
Good idea! |
It's trivial to store the rectangle of the hovered item (we can add that to the library), so you could move the cursor outside of it but you wouldn't know by how much as you don't know where the next item. An hybrid approach to move outward the item by the amount of its width/height and then move smoothly if there's no item under the cursor. It would be easy to implement and may be a little better than a cursor but probably still mediocre. If you are on PS4, I haven't tried it but I suspect the touch pad is precise enough to emulate a mouse.
FYI if your project/company has the fund I'm more than happy to provide custom work on imgui to develop that sort of non-trivial feature (been looking for possible ways to fund its development as I can't really afford it any more myself, at least not at the pace I was working on it a few months ago). Something to consider, may be more optimal than you doing it and it'll benefit the sustainability of the library. It's one of the those feature that's touching quite a lot of elements in the code - quite a complex feature to do right. If you to want to tackle it yourself I can also guide you. |
Sorry for the silence; I forgot the re-mark the mail as unread to get back to it. Your idea to use the PS4 touchpad was pretty effective--it's somewhat finicky, but much better than a stick, and it wasn't too difficult to hook up the sticks and pad for scrolling, either. So, we're good for now; thanks for the suggestion! |
This is VERY interesting 😁 |
This looks great. We'd like to use it for interaction with debug UI in PSVR. It's exactly the kind of thing we need for this. When are you looking to make it available? |
When it is done @MrMarkie :) I've been working on my non-existent spare time until now, but because this feature is now sponsored (a first) I'm aiming before end of July. Will probably start testing and iterating on API and edge cases mid-july. |
Hi. Is there any news on this feature? I'd be happy to help test it if you have a preview version |
I was thinking about pushing a branch but the IO api is utterly temporary/broken yet and it's still missing important features. I'll work on it this week-end. From Monday if you're happy with experimenting with it (at the cost of minor breakage in the following weeks) it would be indeed quite helpful if you want to try it and submit feedback. You can also e-mail me if you want to move this off-line for back and forth. |
Absolutely. Let me know when / where I can get it. Look forwards to trying it out. —You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread. |
…w lower in the function so that Nav branch can use CursorStartPos on the first window frame. (#323) Pushing in master because it _should_ be a no-op but I'd rather test for any issue in Begin() as soon as possible.
This looks excellent!! I'm not finished but I'll be pushing first test version to a branch tonight, along with instructions for those interested. —You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread. |
…e value already stored within the CurrentPopupStack in the previous frame. Doesn't make a big difference here, but will do as gamepad/keyboard navigation will set its own popup position. (#323)
…in upcoming nav commits. Testing power==1.0f without fabsf(). Maybe just use == 1.0f as well? (#323)
…stly a workaround to that activation with enter doesn't validate immediately, which is turns triggers an assert in InputScalarAsWidgetReplacement - can't see an issue with changing it this way so trying out) + using local flag clear_active_id to only clear the active id at the end of the frame, which is one of the step that my stash for #701 requires. (#323)
…ve no side-effects! (So that later we can update Nav between Keyboard and Mouse) (#323)
…coverability and reordered arguments to be more consistent (#323)
…ouseDown[] so that invalid mouse button won't keep breaking nav (#323)
…at seems to be Windows beahvior at least for menus (#323)
… popup/tooltip positioning when using mouse+nav (#323)
…Consistent with expectation & will be used as fallback for nav (#323)
…ed window gets us to the collapse button (#323)
…handle it themselves already anyway. (#323)
MOVING TO #787 |
(ADMIN EDIT July 2016: see #323 (comment) for the current todo list / ongoing tasks)
I've been looking to make our ImGUI accept controller input, for use on consoles. Something like hitting d-pad down to select the next item down, etc.
From what I could tell, however, the only way to do such a thing would be to spoof mouse control. Is this the case? If so, is there a way to ask for the rectangle of a given item outside of the update loop?
I also couldn't find any way to programmatically set the focus of an item other than input text fields; did I miss something?
The text was updated successfully, but these errors were encountered: