Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Mouse and keybinding  (Read 3860 times)

arcibalde

  • Admiral
  • *****
  • Posts: 1730
    • View Profile
Mouse and keybinding
« on: August 09, 2015, 09:45:52 AM »

Is there a program that would allow to bind key sequence on single mouse button?
So, when i click middle mouse button it would execute:  "R" then "3" then "F" then "Left mouse click" then "Q". After every key there would be 200ms delay or so, so it would need to have adjustable delay. Does anyone knows is there any program like that?

I did find AutoHotkey but couldn't figure out is it possible to make what i need in that program.   
Logged
Creator of:
Relics MOD - vanilla balanced - Campaign integrated
Vanilla addon MOD - vanilla balanced - Campaign integrated
Project ONI MOD - mission only

Linnis

  • Admiral
  • *****
  • Posts: 1009
    • View Profile
Re: Mouse and keybinding
« Reply #1 on: August 13, 2015, 08:13:35 PM »

Auto-hotkey is prob the most versatile hotkey program, because you have to write the programs yourself, thus is also the most non user friendly.
But what you need is quite simple


Code
MButton::
send r
Sleep 200
send 3
Sleep 200
send f
Sleep 200
send LButton
Sleep 200
send q

copy that, put it in a txt file, save it and change the extension to .ahk Double click the new AHK file to run (assuming you have installed the latest version of autohotkeys)

Everything in there is super simple and self explanatory so you can fix up whatever parts you want.


Tho what are you using this for? because the Lbutton click is registered just like a mouse click and sometimes can cause mistakes when your cursor is at a diff clickable location

« Last Edit: August 13, 2015, 08:18:32 PM by Linnis »
Logged

hadesian

  • Admiral
  • *****
  • Posts: 2058
  • It's been one of those days...
    • View Profile
Re: Mouse and keybinding
« Reply #2 on: August 14, 2015, 02:23:18 PM »

Logitech gaming software will do that if you have a Logitech mouse.
Logged
Changes as of May 24, 2013
  • Reinvented Starsector.
  • That is all.

Clockwork Owl

  • Admiral
  • *****
  • Posts: 790
    • View Profile
    • Starsector South Korean Community
Re: Mouse and keybinding
« Reply #3 on: August 14, 2015, 09:16:37 PM »

Makes me wonder what you're trying to achieve tho...R-3-F-LMB-Q.  ???
Logged

arcibalde

  • Admiral
  • *****
  • Posts: 1730
    • View Profile
Re: Mouse and keybinding
« Reply #4 on: August 14, 2015, 10:01:54 PM »

Tnx Linnis. Ill try that. I play Skyforge and that is Kinetic skill rotation. Thing is, sometimes , like 2 out of 10 times i screw that rotation, so i figured maybe it's better to have it on one mouse button click so i do it "perfect" 10 out of 10 times. And i got MS industrial mouse so no use of Genius software on it :D


Oh and btw, how do i deactivate it, i only need it in game?
Logged
Creator of:
Relics MOD - vanilla balanced - Campaign integrated
Vanilla addon MOD - vanilla balanced - Campaign integrated
Project ONI MOD - mission only

Linnis

  • Admiral
  • *****
  • Posts: 1009
    • View Profile
Re: Mouse and keybinding
« Reply #5 on: August 15, 2015, 01:16:57 AM »

There are several ways.

1) only activates if your active window is the game window, you will need the windows name as it appears to your pc

2) on and off toggle-able switch

As I dont know what the game window is called, here is a short script for having a overlay on top of your screen showing its active

Press insert to toggle on and off


Code
State=0

Insert::
State:=!State
If state
{
CustomColor = FF6666
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, red
Gui, Font, s18
WinSet, TransColor, %CustomColor% 180
Gui, Add, Text,, ON
Gui, Show, x850 y40 NoActivate, window.
}
If State=false
{
Gui Destory
}
Return


MButton::
If State=false
{
send r
Sleep 200
send 3
Sleep 200
send f
Sleep 200
send LButton
Sleep 200
send q
}
Else
Return
Logged

arcibalde

  • Admiral
  • *****
  • Posts: 1730
    • View Profile
Re: Mouse and keybinding
« Reply #6 on: August 15, 2015, 02:17:55 AM »

Tnx man.
Logged
Creator of:
Relics MOD - vanilla balanced - Campaign integrated
Vanilla addon MOD - vanilla balanced - Campaign integrated
Project ONI MOD - mission only

Linnis

  • Admiral
  • *****
  • Posts: 1009
    • View Profile
Re: Mouse and keybinding
« Reply #7 on: August 15, 2015, 02:48:49 AM »

no probs :>

Gotta love autohotkeys, I use to use it to play two characters in two windows at once in wow. (cuz 1 character is too boring)
Logged

arcibalde

  • Admiral
  • *****
  • Posts: 1730
    • View Profile
Re: Mouse and keybinding
« Reply #8 on: August 15, 2015, 04:12:34 AM »

It says Error: Parameter #1 invalid
Specifically: Destroy
Line#
.
.
.
.
.
022: Gui,Destroy





Thing is in code there is no "," after Gui but in this window about error there is. I did made .ahk file copy/paste your code in it and just Run Script.
Logged
Creator of:
Relics MOD - vanilla balanced - Campaign integrated
Vanilla addon MOD - vanilla balanced - Campaign integrated
Project ONI MOD - mission only

Linnis

  • Admiral
  • *****
  • Posts: 1009
    • View Profile
Re: Mouse and keybinding
« Reply #9 on: August 15, 2015, 08:38:03 AM »

Sorry I am so ***, Its supose to be "Destroy" in the code, but I wrote it as "Destory" instead.

 ;D ;D
Logged