Jump to content

Scripthook .NET Question


Venixlux

Recommended Posts

Firstly, I'm sorry if this is in the wrong place. I have a question about Scripthook, however.

 

Recently I've started work on a callout script to sort of put my knowledge into one project- However due to a lack of scripthook documentation I'm running into a problem.

 

How exactly are modifiers on keypresses supposed to work? I know this should be basic, but I for the life of me cannot figure out how to trigger a keypress like Shift+K or whatever modifier the user specifies in the .ini file.

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

Okay, so the best thing to do is use the scripthook's BindKey functionalitiy.   You can bind a key and multiple modifiers to a method that will be called once that key is pressed.

 

The easiest way to get user configured keys is to also use the scripthook's inbuilt .ini functionality.  You can do this with Settings.GetValueKey(...).

"You tell me exactly what you want, and I will very carefully explain to you why it cannot be."

Link to comment
Share on other sites

Thanks, Sam!

 

I've managed to get the .ini settings loading but I couldn't figure out how to put those keys to use with a modifier. I didn't even realize a function like BindKey existed though.

 

I have another silly question, though. Is there a certain way to bind two keys at once? BindKey(Keys.Shift&Keys.O, new KeyPressDelegate(testMethod)); isn't working properly.

 

Thanks so much for your help!

Edited by Vocosol
Link to comment
Share on other sites

Nope, you don't do it like that.   You use the parameters of BindKey to specifiy modifiers.  like BindKey(Keys.O, true, false, true...);

"You tell me exactly what you want, and I will very carefully explain to you why it cannot be."

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...