EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[LIB] Hotkeys with double click / multiple functions
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
Gazz





Joined: 13 Jan 2006
Posts: 12407 on topic
Location: Bavaria
Thank you for registering your game
modified
PostPosted: Fri, 5. Sep 08, 16:58    Post subject: [LIB] Hotkeys with double click / multiple functions Reply with quote Print

Download file contains versions for both Reunion and Terran Conflict.


Scripters have been doing a good job of conserving command slots (for obvious reasons =) but several scripts use a bucketload of hotkeys instead of grouping several functions, that thematically belong together, onto one hotkey.

Scripts can get a lot easier to use if you only need one hotkey for a group of features instead of several.
(Select weapon config 1, Save weapon config 1.... could be single and double click of the same key.)
That's a lot easier to remember and seldom used functions can be put on a double or triple click layer, freeing up keys on the already cramped keyboard.

I wrote this library for my [SCR] Target Lock Hotkey when it got messy to add one more function to my "hardcoded" hotkey script, that had 3 functions per hotkey at the time.

Now this library supports an infinite number of hotkeys, each with an infinite number of keypresses.
Why only double click when you can quad click?

Download (ZIP)


Now it is that easy to let one hotkey do 2 completely different things:
Code:
001   $HK.Name = get script name
002 @ $Nr.of.clicks = $Null -> call script 'lib.gz.multi.hotkey' :  hotkey name=$HK.Name  keypress delay=400
003   
004   if $Nr.of.clicks == null
005   return null
006
007   else if $Nr.of.clicks == 1
008    $Target =  get player tracking aim
009    $Target -> destruct: show no explosion=null
010   
011   else if $Nr.of.clicks == 2
012    [PLAYERSHIP] -> destruct: show no explosion=null
013   
014   end
015   return null

Line 001 is the easiest and most maintainance free way of generating a solid identifier for a hotkey script.
There are other ways but this one always works. =)


_________________
My complete script download page. . . . . . Xai-Corp MSCI List is scripter's friend. I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.


Last edited by Gazz on Tue, 11. Dec 12, 18:30; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
madpainter



MEDAL

Joined: 06 Dec 2008
Posts: 25 on topic

Thank you for registering your game
PostPosted: Sun, 4. Jan 09, 21:23    Post subject: Reply with quote Print

Hi I am hav'ing trouble using this Is there a specific place I should extract it to or is it simply just a tool for scripters. It seems really useful but I suspect I'm missing something in how to apply it.

Back to top
View user's profile Send private message
MBD





Joined: 27 Mar 2006
Posts: 338 on topic
Location: Down in da 'hood
Thank you for registering your game
PostPosted: Mon, 5. Jan 09, 03:48    Post subject: Reply with quote Print

It goes in the script folder in the games' directory. The Script Editor also needs to be activated.


_________________
"We always were English and we always will be English and it's because we are English that we're sticking up for our rights to be Burgundians." - Passport to Pimlico 1949
Back to top
View user's profile Send private message
s9ilent





Joined: 29 Jun 2005
Posts: 2008 on topic
Location: Galactic Sector ZZ9-Plural Z alpha +10 GMT
Thank you for registering your game
PostPosted: Tue, 13. Jan 09, 13:57    Post subject: Reply with quote Print

Hey Gazz Smile

Just wanted to say, this script is the awesomeness Razz
I can now control many things with just a single button

Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic Reply to topic
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Mon, 23. Oct 17, 08:04

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.23100 seconds, sql queries = 18