Jump to content

Bind keys


Recommended Posts

  • Developer

You should be able to do something similar to what my quick emotes mod does.
 
In modmain.lua

function KeyHandler( key, down )	if down then		if key == GLOBAL.KEY_F1 then --change this to whatever key you want to listen to			--your code goes here		end	endendfunction gamepostinit()	GLOBAL.TheInput:AddKeyHandler( KeyHandler )end--add a post init to the game starting upAddGamePostInit(gamepostinit)

 
 
You could also try using this call instead, but I haven't used it recently.
 

GLOBAL.TheInput:AddKeyDownHandler( GLOBAL.KEY_F1, YourFunction )
Link to comment
Share on other sites

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
 Share

×
  • Create New...