Page 1 of 1

How to get keyboard event on binded key ?

Posted: 07 Dec 2017, 01:13
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 1027 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();                            
                       }         
                }          

Re: How to get keyboard event on binded key ?

Posted: 07 Dec 2017, 02:08
by Miss
I think Dommy already reported this a while ago (this is also a problem in Pursuit).

Re: How to get keyboard event on binded key ?

Posted: 07 Dec 2017, 07:57
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

Re: How to get keyboard event on binded key ?

Posted: 07 Dec 2017, 11:12
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 :)