Jump to content

Capslock


Recommended Posts

It's not possible to check if Caps Lock is enabled. If you really want to do it, you have to add an event onClientKey, check if caps was pressed and then set a variable or something, but then you could mix between enabled on client and disabled in MTA. However it is not possible to check if it is enabled or disabled.

Link to comment

Actually you can do this trick, depending on the purpose you need, it might work (if you only need to detect alphabedic characters):

addEventHandler('onClientCharacter',getRootElement(),function(key)  
     if string.byte(key) > 40 and string.byte(key) < 91  then -- pressed an alphabedical symbol with CAPS LOCK ON! 
          --do something when character with caps lock on entered 
     elseif if string.byte(key) > 96 and string.byte(key) < 123  then -- pressed a symbol with CAPS LOCK OFF! 
          --do something when character with caps lock off entered 
     end 
end) 

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...