greenworks icon indicating copy to clipboard operation
greenworks copied to clipboard

Support Big Picture APIs.

Open hokein opened this issue 9 years ago • 9 comments

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 (call greenworks.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

hokein avatar Nov 25 '15 05:11 hokein

@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.

hokein avatar Nov 25 '15 07:11 hokein

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);

hokein avatar Nov 25 '15 09:11 hokein

Have these APIs been merged into the main Greenworks build yet?

HughIsaacs2 avatar Oct 13 '16 10:10 HughIsaacs2

@HughIsaacs2 not yet, since I don't have device to test them...

hokein avatar Oct 13 '16 20:10 hokein

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).

HughIsaacs2 avatar Oct 13 '16 20:10 HughIsaacs2

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 avatar Mar 02 '17 00:03 cvan

@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.

hokein avatar Mar 03 '17 21:03 hokein

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!

framerate avatar Jun 17 '17 23:06 framerate

Hi @hokein Can I used gamepad now?

Canvasfull avatar Oct 09 '22 02:10 Canvasfull