How to get keyboard event on binded key ?

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
reaby
Posts: 887
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

How to get keyboard event on binded key ?

Post by reaby » 07 Dec 2017, 01:13

Hi,

I would like to create tabbed interface to chat as seen below.
(Symfony dev mode keeps events in memory for debugging, so memory increases that's intented behaviour and doesn't happen on prod mode)
tabs.PNG
Currently problem is when I hide default chat, I can't get events from the binded buttons on keyboard.
Actually CharPressed T some times works, but enter-key never... any ideas ?

Code: Select all

 
   if (ClientUI.OverlayHideChat == True && (Event.CharPressed == "T" || Event.KeyCode == 36 )) {
                       if (CustomTextEntry.Visible) {
                            CustomTextEntry.Hide();       
                       } else {
                            CustomTextEntry.Show();
                            CustomTextEntry.StartEdition();                            
                       }         
                }          
You do not have the required permissions to view the files attached to this post.

User avatar
Miss
Posts: 796
Joined: 05 Jan 2016, 11:34
Location: The Netherlands
Contact:

Re: How to get keyboard event on binded key ?

Post by Miss » 07 Dec 2017, 02:08

I think Dommy already reported this a while ago (this is also a problem in Pursuit).
Forum moderator :thx: Check out Image openplanet, the alternative Maniaplanet scripting platform!
I also stream!

User avatar
Dommy
Translator
Translator
Posts: 1706
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

Re: How to get keyboard event on binded key ?

Post by Dommy » 07 Dec 2017, 07:57

That's the exact problem I'm currently having with my chat - CMlEvent::Type::KeyPress for "T" is fired randomly, unlike all other keys. What's weird, is that issue doesn't apply in spectator mode (tested in TrackMania only). Enter always worked for me, however.

There is yet one more problem with custom chat: entries send unwanted CMlEvent::Type::EntrySubmit event when unfocused, meaning you will send a message if you typed something and click anywhere else on screen.

Might be useful:
https://github.com/domino54/title-packs ... t.txt#L191
https://github.com/domino54/title-packs ... Script.txt

reaby
Posts: 887
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: How to get keyboard event on binded key ?

Post by reaby » 07 Dec 2017, 11:12

Ok.. Thanks to know i'm not alone with this :)
I'll try to find the bugreport and post in there also, lets hope it gets fixed at some point :)

Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 2 guests