Project

General

Profile

Is it possible to get Immediate data from WText?

Added by Sam Campbell over 3 years ago

Hey there!

I've been having a little play around with WT and it seems like an amazing tool, I've already been having some filling some old structs with the modified Hello World demo.

Before I spend hours looking at this though, I would like to know if there is a simple way to get immediate keystrokes back from a browser?
My current project is inside a game engine, it is my wish that a remote user on the same wired network can load a web page and type information/jokes/insults etc which is rendered 'live' to the screen.

Is there such a method?

Apologies, I'm middling/beginner with C++ and this is an incredibly feature rich library.

Best Regards.


Replies (2)

RE: Is it possible to get Immediate data from WText? - Added by Bruce Toll over 3 years ago

The Wt Hangman example accepts upper-case Letters from the keyboard as they are typed (if Javascript is available). You can take a look at how globalKeyPressed() is used in examples/hangman/LettersWidget.C.

For additional documentation, see: https://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WApplication.html#a7d8f807eee7191ae6b7f6f7fe2ab2fae

The hangman example is available online here: https://www.webtoolkit.eu/wt/documentation/examples/hangman (scroll down and click on "Run Example")

    (1-2/2)