greenworks
greenworks copied to clipboard
Support Big Picture APIs.
Fixes #60
After discussing with @patrickklug, currently we have no plan to support steam controller APIs since these APIs are too specific.
This PR exposes the Steam Big Picture APIs:
greenworks.on("gamepad-text-input-dismissed", function(submitted, unsubmittedText) {})
- submitted
Boolean
: true if user entered & accepted text (callgreenworks.getEnteredGamepadTextInput()
for text), false if canceled input. - unsubmittedText:
Integer
Emits when Steam Big Picture gamepad text input has been closed.
greenworks.showGamepadTextInput(inputMode, inputLineMode, description, charMax, existingText)
- inputMode:
greenworks.GamepadTextInputMode
- inputLineMode:
greenworks.GamepadTextInputLineMode
- description:
String
- charMax:
Integer
- existingText:
String
Activates the Big Picture text input dialog which only supports gamepad input
greenworks.getEnteredGamepadTextLength()
Returns previously entered text's length
greenworks.getEnteredGamepadTextInput(cchText)
- cchText:
Integer
Returns previously entered text
Enum values:
- greenworks.GamepadTextInputMode.Normal
- greenworks.GamepadTextInputMode.Password
- greenworks.GamepadTextInputLineMode.SingleLine
- greenworks.GamepadTextInputLineMode.MultipleLines
@patrickklug I haven't test these APIs because I don't have a gamepad device, now I made a prebuilt binary for nw.js 0.8.6 with Steam SDK 1.35 in https://drive.google.com/file/d/0Bx5px5HgHtBxMXdndVpRaXo1NXM/view?usp=sharing Feel free to test it and report any issue you encounter.
Just for more info.
If anyone who wants to build greenworks for nw.js v0.8.6, he will encounter a call to New is ambiguous
compilation error caused by nan v2. The reason is that nw.js v0.8.6 uses a newer v8 version than node v0.10, which nan v2 doesn't support well.
The current workaround is to modify a file in nan. Below shows the way in nan v2.1.0:
Change the line 112 in nan_implementation_pre_12_inl.h
to
return v8::FunctionTemplate::New((v8::InvocationCallback)0, data, signature);
Have these APIs been merged into the main Greenworks build yet?
@HughIsaacs2 not yet, since I don't have device to test them...
I don't think you need a gamepad to use the on screen keyboard in Big Picture mode, and even if so I can definitely say it works with any XInput gamepad (I've used it with my Xbox One controller).
So gamepad or not there should be a way to emulate one (there's a ton of Phone to XInput or even keyboard to XInput apps out there).
hi there, just checking to see the status of this PR. is there anything blocking this from getting merged, any issues that need sorting out first?
@cvan, this PR is kind of outdated, I need to rebase it. Originally this feature was requested by @patrickklug, but he switched to other stuff and didn't get time to play it around.
Do you need this feature? I may pick it up.
Do you need this feature? I may pick it up.
I think anything to improve this library is important, as more and more games coming down the pipe that will want to use it!
Hi @hokein Can I used gamepad now?