Author Topic: Using Modifier Keys for Skills  (Read 16388 times)

Offline Penumbra

  • Sr. Member Mark III
  • ****
  • Posts: 464
Using Modifier Keys for Skills
« on: April 24, 2012, 01:42:36 pm »
Update: Look for final "solution" without using AutoHotkey on page 2, here.

I really like having as many different skills available for me to use at a moments notice, with minimal fussing or rearranging the skill bar. I use ESDF instead of WASD so that I can map all the surrounding keys to spells and commonly used functions. WRTGV, along with a 5 button mouse, gives me all 10 slots within easy reach, but there are many, many more useful abilities than that!

The addition of the new skill bindings gives me the opportunity to have another 20+ skills, but does not give me either more keys or larger hands  ;)

Using Shift and Alt, along with the mouse keys allows me to bind 15 abilities to my mouse, which is really useful. I have Wooden Platforms on middle click, and crates on Shift-middle click. Energy Slice on button-4, Energy Orb on Alt-button-4, you get the idea.

This allows me to have very similar spells on the same physical button while  using the modifiers to change what they do on the fly based on the situation.

You cannot bind these modifier keys in the configuration options as anything but direct inputs, so to set this up I used Auto Hotkey along with binding the extra skill bars to the number-pad. I have attached the script to this post along with showing it.

This script binds the WRTGV keys with shift, and the 5 mouse buttons with both shift and alt modifiers. If you want to change how this works, it is fairly simple to modify. The !^+ symbols represent Alt, Control and Shift
Code: [Select]
! Alt
^ Control
+ Shift

The Left, Right and Middle mouse buttons are used just as regular keys, and the XButton1 and 2 refer to mouse buttons 4 and 5.

The standard remapping syntax for keys in Auto Hotkey is to just use the :: operator, but there are problems involving Unity, losing focus, and the modifier keys getting stuck. So I used a dual mapping of the up and down states for the keys. That seems to keep them from getting stuck. It still happens rarely, but you just need to hit the corresponding numpad key to stop it.

 As you are editing, make sure you edit both lines for each remapping. For a full list of available keys, see here

Code: [Select]
#IfWinActive, ahk_class UnityWndClass

;Ability 11
+LButton::Send {Numpad1 Down}
+LButton Up::Send {Numpad1 Up}

;Ability 12
+RButton::Send {Numpad2 Down}
+RButton Up::Send {Numpad2 Up}

;Ability 13
+MButton::Send {Numpad3 Down}
+MButton Up::Send {Numpad3 Up}

;Ability 14
+XButton1::Send {Numpad4 Down}
+XButton1 Up::Send {Numpad4 Up}

;Ability 15
+XButton2::Send {Numpad5 Down}
+XButton2 Up::Send {Numpad5 Up}


;Ability 21
!LButton::Send {Numpad6 Down}
!LButton Up::Send {Numpad6 Up}

;Ability 22
!RButton::Send {Numpad7 Down}
!RButton Up::Send {Numpad7 Up}

;Ability 23
!MButton::Send {Numpad8 Down}
!MButton Up::Send {Numpad8 Up}

;Ability 24
!XButton1::Send {Numpad9 Down}
!XButton1 Up::Send {Numpad9 Up}

;Ability 25
!XButton2::Send {Numpad0 Down}
!XButton2 Up::Send {Numpad0 Up}


;Ablitiy 16
+w::Send {NumpadDiv Down}
+w Up::Send {NumpadDiv Up}

;Ablitiy 17
+r::Send {NumpadMult Down}
+r Up::Send {NumpadMult Up}

;Ablitiy 18
+t::Send {NumpadSub Down}
+t Up::Send {NumpadSub Up}

;Ablitiy 19
+g::Send {NumpadAdd Down}
+g Up::Send {NumpadAdd Up}

;Ablitiy 20
+v::Send {NumpadDot Down}
+v Up::Send {NumpadDot Up}

;Ablitiy 26
+w::Send {6 Down}
+w Up::Send {6 Up}

;Ablitiy 27
+r::Send {7 Down}
+r Up::Send {7 Up}

;Ablitiy 28
+t::Send {8 Down}
+t Up::Send {8 Up}

;Ablitiy 29
+g::Send {9 Down}
+g Up::Send {9 Up}

;Ablitiy 30
+v::Send {0 Down}
+v Up::Send {0 Up}


« Last Edit: May 08, 2012, 06:33:23 pm by Penumbra »

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Using Modifier Keys for Skills
« Reply #1 on: April 24, 2012, 01:53:09 pm »
I thought this might get more traction if it started in the main forum but then moved to mods and maps.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline mrhanman

  • Hero Member Mark II
  • *****
  • Posts: 764
Re: Using Modifier Keys for Skills
« Reply #2 on: April 24, 2012, 02:32:50 pm »
I'm all for more flexible control setup.  I'm not sure if I'd use it personally, but then again having platforms and crates on one button sure sounds nice.  8)

Hell, I've already got Auto Hotkey installed for DF, so I think I'll give this a try.  Thanks for sharing Penumbra!  Should a request for this go up on Mantis?  It'd be awesome if this didn't require an external program.

Offline Penumbra

  • Sr. Member Mark III
  • ****
  • Posts: 464
Re: Using Modifier Keys for Skills
« Reply #3 on: April 24, 2012, 04:16:21 pm »
There is already a Mantis issue about allowing the modifier keys to be used as such, but there are certain limitations of the Unity 3D engine that make it problematic.  I wrote this script because of that.
« Last Edit: April 24, 2012, 04:18:26 pm by Penumbra »

Offline Kronic

  • Newbie Mark III
  • *
  • Posts: 45
Re: Using Modifier Keys for Skills
« Reply #4 on: April 24, 2012, 04:24:17 pm »
I use ESDF instead of WASD

I loved you by this line, the rest was just icing. :)

Offline Penumbra

  • Sr. Member Mark III
  • ****
  • Posts: 464
Re: Using Modifier Keys for Skills
« Reply #5 on: April 24, 2012, 04:25:50 pm »
I use ESDF instead of WASD

I loved you by this line, the rest was just icing. :)

And, now I know there are at least two of us!

Offline tigersfan

  • Arcen Games Contractor
  • Arcen Staff
  • Master Member Mark II
  • *****
  • Posts: 1,599
Re: Using Modifier Keys for Skills
« Reply #6 on: April 24, 2012, 04:29:43 pm »
I use ESDF instead of WASD

I loved you by this line, the rest was just icing. :)

Arcen Games. Bringing folks together since 2012!

Offline Penumbra

  • Sr. Member Mark III
  • ****
  • Posts: 464
Re: Using Modifier Keys for Skills
« Reply #7 on: April 25, 2012, 02:57:15 am »
In case someone was interested, here is the keybindings I'm using for ESDF and the extended bindings.

Code: [Select]
KeyBinding:TakeScreenshot|F12|None|None|None|None|None|None|10
KeyBinding:MarkAllLocalMessagesAsNew|BackQuote|None|None|None|None|None|None|10
KeyBinding:PauseLocalChunk|Q|Pause|None|None|None|None|None|10
KeyBinding:Debug|F3|None|None|None|None|None|None|10
KeyBinding:DebugNetwork|F2|None|None|None|None|None|None|10
KeyBinding:DebugCollision|F4|None|None|None|None|None|None|10
KeyBinding:DebugGhostInvisible|F5|None|None|None|None|None|None|10
KeyBinding:DebugBaseTileLayerInfo|F6|None|None|None|None|None|None|10
KeyBinding:DebugCTLTileLayerInfo|F6|None|LeftControl|None|None|None|None|10
KeyBinding:DebugEntityAlignmentMode|F7|None|None|None|None|None|None|10
KeyBinding:Ingame_Left|S|LeftArrow|None|None|None|None|Left|10
KeyBinding:Ingame_Right|F|RightArrow|None|None|None|None|Right|10
KeyBinding:Ingame_Down|D|DownArrow|None|None|None|None|Down|10
KeyBinding:Ingame_Up|E|UpArrow|None|None|None|None|Up|10
KeyBinding:Ingame_Jump|Space|None|None|None|None|JoystickButton1|None|10
KeyBinding:Ingame_ConfirmOrAction2|A|Return|None|None|None|JoystickButton0|None|10
KeyBinding:SwitchDirectlyTargetedEntity|Tab|None|None|None|None|JoystickButton11|None|10
KeyBinding:SwitchActiveAbilityBar|None|None|None|None|None|JoystickButton10|None|10
KeyBinding:SwitchActiveAbilityBarReverse|None|None|None|None|None|None|None|10
KeyBinding:SwitchFirstMouseAbilitySlot_UKB2|None|None|None|None|None|None|None|10
KeyBinding:SwitchFirstMouseAbilitySlotReverse_UKB2|None|None|None|None|None|None|None|10
KeyBinding:Ingame_AimUp|None|None|None|None|None|None|Negative5th|5
KeyBinding:Ingame_AimDown|None|None|None|None|None|None|Positive5th|5
KeyBinding:Ingame_AimLeft|None|None|None|None|None|None|Negative4th|5
KeyBinding:Ingame_AimRight|None|None|None|None|None|None|Positive4th|5
KeyBinding:Ingame_UseAbility1|None|None|None|None|None|JoystickButton2|None|10
KeyBinding:Ingame_UseAbility2|None|None|None|None|None|JoystickButton3|None|10
KeyBinding:Ingame_UseAbility3|None|None|None|None|None|JoystickButton4|None|10
KeyBinding:Ingame_UseAbility4|None|None|None|None|None|JoystickButton5|None|10
KeyBinding:Ingame_UseAbility5|None|None|None|None|None|JoystickButton6|None|10
KeyBinding:Ingame_UseAbility6|W|None|None|None|None|JoystickButton7|None|10
KeyBinding:Ingame_UseAbility7|R|None|None|None|None|JoystickButton9|None|10
KeyBinding:Ingame_UseAbility8|T|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility9|G|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility0|V|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility11|Keypad1|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility12|Keypad2|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility13|Keypad3|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility14|Keypad4|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility15|Keypad5|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility16|KeypadDivide|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility17|KeypadMultiply|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility18|KeypadMinus|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility19|KeypadPlus|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility20|KeypadPeriod|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility21|Keypad6|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility22|Keypad7|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility23|Keypad8|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility24|Keypad9|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility25|Keypad0|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility26|Alpha6|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility27|Alpha7|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility28|Alpha8|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility29|Alpha9|None|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility30|Alpha0|None|None|None|None|None|None|10
KeyBinding:Ingame_MouseAbility1_UKB1|None|None|None|None|Mouse0|None|None|10
KeyBinding:Ingame_MouseAbility2_UKB1|None|None|None|None|Mouse1|None|None|10
KeyBinding:Ingame_MouseAbility3_UKB1|None|None|None|None|Mouse2|None|None|10
KeyBinding:Ingame_MouseAbility4_UKB1|None|None|None|None|Mouse3|None|None|10
KeyBinding:Ingame_MouseAbility5_UKB1|None|None|None|None|Mouse4|None|None|10
KeyBinding:Ingame_MouseAbility6_UKB1|None|None|None|None|Mouse5|None|None|10
KeyBinding:Ingame_MouseAbility7_UKB1|None|None|None|None|Mouse6|None|None|10
KeyBinding:OpenMenu_System|Escape|None|None|None|None|JoystickButton8|None|10
KeyBinding:OpenChatPopup_UKB2|I|None|None|None|None|None|None|10
KeyBinding:OpenChunkMap|M|None|None|None|None|None|None|10
KeyBinding:OpenDungeonMap|Comma|None|None|None|None|None|None|10
KeyBinding:OpenRegionMap|Period|None|None|None|None|None|None|10
KeyBinding:Menu_CursorDown|DownArrow|None|None|None|None|None|Down|10
KeyBinding:Menu_CursorUp|UpArrow|None|None|None|None|None|Up|10
KeyBinding:Menu_CursorLeft|LeftArrow|None|None|None|None|None|Left|10
KeyBinding:Menu_CursorRight|RightArrow|None|None|None|None|None|Right|10
KeyBinding:Menu_ConfirmOrAction2|A|Return|None|None|None|JoystickButton0|None|10
KeyBinding:Menu_Cancel|Escape|None|None|None|None|JoystickButton1|None|10
KeyBinding:Menu_SwitchToNextMainTab|Tab|None|None|None|None|JoystickButton3|None|10
KeyBinding:SwitchToGhostMode_UKB1|G|None|LeftControl|None|None|None|None|10
KeyBinding:SwitchToNonGhostMode_UKB1|H|None|LeftControl|None|None|None|None|10
KeyBinding:TriggerAllPointsOfInterest|O|None|None|None|None|None|None|10
KeyBinding:DebugRecreateTestChunk|K|None|LeftControl|None|None|None|None|10
KeyBinding:DebugReloadParticlePatterns|F4|None|LeftControl|None|None|None|None|10
KeyBinding:DebugReloadLanguageFiles|F5|None|LeftControl|None|None|None|None|10
KeyBinding:DebugShowAllRegions|F3|None|LeftControl|None|None|None|None|10
KeyBinding:OpenDebugMenu|L|None|None|None|None|None|None|10
KeyBinding:ResetAimingReticle|U|None|None|None|None|None|None|10
KeyBinding:Ingame_DoLookAhead_UKB1|L|None|None|None|None|None|None|10
KeyBinding:Ingame_Walk|LeftControl|None|None|None|None|None|None|10
KeyBinding:OpenInventory_Usable2|X|I|None|None|None|None|None|10
KeyBinding:OpenInventory_Commodities|K|None|None|None|None|None|None|10
KeyBinding:OpenReference_Planning|P|None|None|None|None|None|None|10
KeyBinding:Visualizer_ShiftWest_UKB1|LeftArrow|None|LeftControl|None|None|None|None|10
KeyBinding:Visualizer_ShiftEast_UKB1|RightArrow|None|LeftControl|None|None|None|None|10
KeyBinding:Visualizer_ShiftUp_UKB1|UpArrow|None|LeftControl|None|None|None|None|10
KeyBinding:Visualizer_ShiftDown_UKB1|DownArrow|None|LeftControl|None|None|None|None|10
KeyBinding:SwapLeftAndRightMouseButtons|None|None|None|None|None|None|None|10
KeyBinding:ForceDropQuantityToAll|LeftControl|None|None|None|None|None|None|10
KeyBinding:OpenInventory_Enchants2|Z|None|None|None|None|None|None|10
KeyBinding:DebugDoMemoryProfilingSample|F9|None|None|None|None|None|None|10
KeyBinding:Ingame_ShowAllRegionLevels|H|None|None|None|None|None|None|10
KeyBinding:Ingame_UseCrate|None|None|None|None|None|None|None|10
KeyBinding:Ingame_UsePlatform|None|None|None|None|None|None|None|10
KeyBinding:Ingame_UseShield|None|None|None|None|None|None|None|10
KeyBinding:Ingame_UseBallOfLight|None|None|None|None|None|None|None|10
KeyBinding:Ingame_UseFlare|None|None|None|None|None|None|None|10
KeyBinding:Ingame_UseLightSnake|None|None|None|None|None|None|None|10
KeyBinding:Ingame_UseFlashOfLight|None|None|None|None|None|None|None|10

« Last Edit: April 26, 2012, 12:13:55 am by Penumbra »

Offline Wanderer

  • Master Member Mark II
  • *****
  • Posts: 1,579
  • If you're not drunk you're doing it wrong.
Re: Using Modifier Keys for Skills
« Reply #8 on: April 25, 2012, 03:47:35 am »
I'm really starting to feel if I want to really play this heavily I should get my hands on a 5-button mouse.  Mapping in Light Ball alone would make my life easier.

Out of curiousity, what did you do with the ol 'Press E to enter' bit, especially for moving 'up' on the main map screen?
... and then we'll have cake.

Offline Mánagarmr

  • Core Member Mark V
  • *****
  • Posts: 4,272
  • if (isInRange(target)) { kill(target); }
Re: Using Modifier Keys for Skills
« Reply #9 on: April 25, 2012, 06:34:30 am »
*hugs his Merc keyboard*. LOTS of but-tens!
Click here to get started with Mantis for Suggestions and Bug Reports.

Thank you for contributing to making the game better!

Offline Penumbra

  • Sr. Member Mark III
  • ****
  • Posts: 464
Re: Using Modifier Keys for Skills
« Reply #10 on: April 25, 2012, 09:12:00 am »
I'm really starting to feel if I want to really play this heavily I should get my hands on a 5-button mouse.  Mapping in Light Ball alone would make my life easier.
It does help, and you can find them pretty cheap almost anywhere. Personally, I use trackballs because I find them much more accurate, clicking doesn't mess up your aim, and I never have to pick it up and move it to keep moving around  :D

Out of curiousity, what did you do with the ol 'Press E to enter' bit, especially for moving 'up' on the main map screen?

I map Use in every game to "A" because it is used so often. I have never really understood how anyone who can type can use WASD without screaming in frustration in about a minute, but again that's just me   ;) And the beauty of PC gaming is "to each his own"

Offline Penumbra

  • Sr. Member Mark III
  • ****
  • Posts: 464
Re: Using Modifier Keys for Skills
« Reply #11 on: April 26, 2012, 12:16:29 am »
Updated the script in the first post, along with the keybindings. I was not taking advantage of the regular numbers on the keyboard!  ::)

This oversight has been fixed, and now abilities 26-30 are bound to keys 6-0 and mapped to Alt-WRTGV

Offline Quaix

  • Jr. Member Mark II
  • **
  • Posts: 75
Re: Using Modifier Keys for Skills
« Reply #12 on: April 27, 2012, 04:43:58 am »
Instead of MButton I recently started using WheelUp and WheelDown, which gives me an extra button. Works great for discrete actions which don't require holding down the button. (I use WheelDown for placing platforms) WheelUp might work great for SplashBack spell in an emergency, or flick it to place a light orb.


Offline crayo

  • Newbie
  • *
  • Posts: 7
Re: Using Modifier Keys for Skills
« Reply #13 on: April 29, 2012, 11:49:13 am »
Is it necessary to use an external utillity like Auto HotKey?

I was able to set up modifier keys using the default/stock game by editing the inputbindings.dat file in a text editor. . . It seems to me the game already supports this there just isn't a way to set it in the game itself (since pressing shift/etc sets the key to shift).

Here's an example from my inputbindings.dat:

KeyBinding:Ingame_UseAbility0|Alpha0|Keypad0|None|None|None|None|None|10
KeyBinding:Ingame_UseAbility11|Alpha1|None|LeftShift|None|None|None|None|10

Those 2 entries set up the '0' key to use "power 10" (default) and then 'LeftShift + 1' to cast "power 11". It works for me in game, it's just not extremely user friendly to edit.
"As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

Offline Quaix

  • Jr. Member Mark II
  • **
  • Posts: 75
Re: Using Modifier Keys for Skills
« Reply #14 on: April 29, 2012, 12:10:27 pm »
In case anyone is interested, here's some code to trigger an action using double tap:

Code: [Select]
d::
Last:=(Last == "" ? 0 : Last)
If (GetKeyState("d") == 0)
{
  If (A_TickCount - Last < 200)
  {
    Send, {NumPadDiv}
  }
  Last:=A_TickCount
}
Send, {d Down}
return
d Up::Send, {d Up}

So when I double tap d (which is bound to down), it sends NumPadDiv, which is bound to Miniaturize spell in the game.
200 is the max time between keypresses. 150 to 200 works pretty well.