[Bug?] Pressing Enter clicks the link under the mouse cursor

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

Post Reply
User avatar
m4rcel
Posts: 650
Joined: 15 Jun 2010, 11:12
Contact:

[Bug?] Pressing Enter clicks the link under the mouse cursor

Post by m4rcel »

I don't know if this actually is a bug, or a planned feature. If your mouse is over a link (linked label or Quad, or some element with ScriptEvents="1"), pressing Enter will let you press this link.

As soon as you listen on the Enter key via ManiaScript, this becomes a problem: Instead of receiving the KeyPress event of Enter (e.g. to start the game on Tetris), you click the link below the mouse cursor, which may be confusing to the user. So I personally think, this "Click with Enter" feature (if it is one) should be removed.
ImageImage
Image
TomRiddle
Posts: 250
Joined: 14 Jul 2011, 16:16

Re: [Bug?] Pressing Enter clicks the link under the mouse cu

Post by TomRiddle »

uhm this was included to tmf also. you can change the object focus with tab and then you can click with enter.
User avatar
TMarc
Posts: 15255
Joined: 05 Apr 2011, 19:10
Location: Europe
Contact:

Re: [Bug?] Pressing Enter clicks the link under the mouse cu

Post by TMarc »

You have also to consider that people might use only keyboard or joystick, like with a game console, and discard the mouse completely while playing ;)
konte
Posts: 236
Joined: 15 Jun 2010, 12:36
Location: Germany

Re: [Bug?] Pressing Enter clicks the link under the mouse cu

Post by konte »

But you don't have actual links in Tetris anyway, do you? :P

Concerning what TMarc and TomRiddle said: I would rather improve the Tab handling^^ I think sorting the objects from top to bottom of the script would be better than from left to right of the screen or what it is at the moment.

Anyway, in my opinion global functions should be kept above specific MS handling. And this is not such a big problem anyway...
User avatar
m4rcel
Posts: 650
Joined: 15 Jun 2010, 11:12
Contact:

Re: [Bug?] Pressing Enter clicks the link under the mouse cu

Post by m4rcel »

Controls with ScriptEvents="1" count as links, too. So if you have your mouse over the Menu and press Enter to start or pause the game, you instead "click" in the Menu on that control below the mouse. And this is what I find confusing...
ImageImage
Image
konte
Posts: 236
Joined: 15 Jun 2010, 12:36
Location: Germany

Re: [Bug?] Pressing Enter clicks the link under the mouse cu

Post by konte »

okay, I didn't realise that part. Then, at least a distinction between clicking and pressing enter or an additional property (enter used) would make sense there, since not even all the ScriptEvents="1" (and I suppose, action="1" will have the same behaviour) elements are supposed to be clicked but maybe are just to detect mouse hovering.

But for your script, one idea: Insert a if-condition at the beginning of the while(True) loop, with KeyReturn as the condition. If it's true, do your start-the-game code and then add a continue to the end, so that no other code will be executed (and a yield should be at some point, of course).

And a general suggestion would be just not to use Enter at all but Space for example :P
User avatar
m4rcel
Posts: 650
Joined: 15 Jun 2010, 11:12
Contact:

Re: [Bug?] Pressing Enter clicks the link under the mouse cu

Post by m4rcel »

konte wrote:But for your script, one idea: Insert a if-condition at the beginning of the while(True) loop, with KeyReturn as the condition. If it's true, do your start-the-game code and then add a continue to the end, so that no other code will be executed (and a yield should be at some point, of course).
This is a very nice idea, thank you. If I have a free time, I will look if I can workaround this ;)
konte wrote:And a general suggestion would be just not to use Enter at all but Space for example :P
I personally prefer to have a Enter as a key for such basic actions especially for pausing the game, as you can hit it very fast (because of its size) if you have to get afk very quickly ;) (And space is already in use ^^)
(Nevertheless, each user can still change this key to anything else... Thanks to the free configurable controls of Tetris :D )
ImageImage
Image
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 1 guest