Jump to content

Binding Keys in guiElements


Lavire

Recommended Posts

Hi guys,

I'm a beginner at LUA and after creating an account system with MySQL (which works just fine), I'm trying to make the GUI more comfortable, so that the players can just enter their password (I somehow managed to focus on the textedit element haha) and hit their Enter-key on their keyboard!

I know how the bindKey function works, and I managed to get it working on keys like F1, F2, ... but it just won't let me do it with the Enter-key!

My code:

guiSetVisible(tabPanel, true) 
guiBringToFront(edtPass) 
--guiSetInputMode("allow_binds")    I tried it with and without guiSetInputMode (I would prefer without) 
unbindKey("enter") 
bindKey("enter", "down", 
function(player, key, state) 
       clientSubmitLogin("left", "up") 
end) 
showCursor(true) 
guiSetInputEnabled(true) 

I want it to execute my clientSubmitLogin function. It works with F1 and so on, but not with Enter, I'd appreciate any help.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...