Open Arthegal opened 9 years ago
Log seems to tell us that:
Error: In run/evaluate: Error: QKeySequence::QKeySequence(): could not find a function match; candidates are:
QKeySequence()
QKeySequence(StandardKey key)
QKeySequence(QKeySequence ks)
QKeySequence(String key)
QKeySequence(String key, SequenceFormat format)
QKeySequence(int k1, int k2, int k3, int k4)
So, it would appear there is no constructor taking Qt::Key enum. Sorry about the erroneous example in the documentation. Using the QString constructor instead should help:
var moveFwd = ic.RegisterKeyEvent(new QKeySequence("W"));
// ...
I will update and fix the documentation in the near future.
Oh, and just making sure that you're trying this with a Meshmoon Tundra/Rocket, and not a realXtend Tundra? This feature has not been merged to realXtend Tundra.
Thanks for updating the documentation, i just copy paste the code from documentation and forgot to mention that in my code i have declared a valid sequence (Qt.ControlModifier + Qt.Key_F). I'm using realXtend Tundra (tundra2 branch up to date), and i was thinking it was implemented since KeyEventSignal &InputContext::RegisterKeyEvent(QKeySequence keySequence) is implemented in InputContext.cpp, but everything needed has maybe not alredy merged.....
Many thanks for you feedback
Ali what has not been merged? Seems to all be there, no?
Oh seems that the register func is not returning a ptr https://github.com/realXtend/tundra/blob/f0b8d159870d8d6e86ec662e49fb2980409525ff/src/Core/TundraCore/Input/InputContext.cpp#L30 in rex Tundra. Its a public slot though, might even work? :)
Unfortunately QtScript doesn't understand refs, only ptrs, so this has never worked in rex Tundra. I have changed it to return ptr instead in Meshmoon Tundra in order to make it work.
@Arthegal Do the following changes
Change KeyEventSignal &
to KeyEventSignal *
in https://github.com/realXtend/tundra/blob/f0b8d159870d8d6e86ec662e49fb2980409525ff/src/Core/TundraCore/Input/InputContext.cpp#L30 and also same thing in the header (find the func declaration InputContext.h).
Change return *signal;
to return signal;
in https://github.com/realXtend/tundra/blob/f0b8d159870d8d6e86ec662e49fb2980409525ff/src/Core/TundraCore/Input/InputContext.cpp#L37
Those should get you going :)
More changes are needed: ee8f676cedbb3cecb0ff975084ad934b75671846 . I would recommend simply waiting that our fixes get to upstream.
Hmm does does the commit show up in realxtend/Tundra if its not merged yet? I suspect he could cherry pick the commit fine if you would find the meshmoon commit id for him. Oh well...
Have to admit i'm really impressed by your reactivity and support. The change ee8f676 do the trick.
Thank you so much for your help and more generally for this wonderful project. ;-)
You're welcome!
just one thing I like about these guys.... ;)
Hi guru, long time no see! :) I'm making 64bit linux .deb packages for Meshmoon Rocket, Ubuntu 14.04 in particular. Maybe you would be interested in doing some testing when they are done? If I remember right you were working quite a lot in linux?
I'm trying the following code from documentation of InputMapper to migrate to InputContext
var moveFwd = ic.RegisterKeyEvent(new QKeySequence(Qt.Key_W)); moveFwd.SequencePressed.connect(function() { me.Exec(EntityAction.Server, "Move", "forward"); });
But moveFwd is always undefined!
Thanks in advance