How to get keyboard event on binded key ?

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

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

How to get keyboard event on binded key ?

Post by reaby »

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
tabs.PNG (193.17 KiB) Viewed 720 times
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();                            
                       }         
                }          
User avatar
Miss
Posts: 2155
Joined: 05 Jan 2016, 11:34
Location: The Netherlands
Contact:

Re: How to get keyboard event on binded key ?

Post by Miss »

I think Dommy already reported this a while ago (this is also a problem in Pursuit).
3080 RTX, Ryzen 3700X, 32GB RAM, Windows 11
Forum moderator, opinions are my own. :thx:
Check out Image openplanet, the alternative ManiaPlanet & Turbo scripting platform! (Openplanet subforum)
I also stream and tweet.
User avatar
Dommy
Translator
Translator
Posts: 1901
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

Re: How to get keyboard event on binded key ?

Post by Dommy »

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
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

Contact me via GALAXY & PURSUIT DISCORD
reaby
Posts: 1032
Joined: 29 Dec 2010, 23:26
Location: Eastern Finland
Contact:

Re: How to get keyboard event on binded key ?

Post by reaby »

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 1 guest