• Editor
  • Configurable hotkeys are here

  • Modifié
Related Discussions
...

As of 1.6.16, hotkeys are now configured via a text file:

Windows: <user home folder>\Spine\hotkeys.txt
Mac: <user home folder>/Library/Application Support/Spine/hotkeys.txt
Linux: <user home folder>/.spine/hotkeys.txt

This file will be created if it doesn't exist, otherwise it uses the one that is there. It's a text format and should be pretty clear how it works. An excerpt:



---

 Tools 

---


Scale Tool: X
Rotate Tool: C
Translate Tool: V
Pose Tool: B
Create Tool: N

Case and whitespace don't matter. Lines starting with


are comments.

You can use ctrl+shift+alt+KEYNAME or any combination of those modifiers. The key names can be any of the constants defined here:
https://github.com/libgdx/libgdx/blob/m ... t.java#L63
I'll put those in proper documentation at some point.

If a key name is a single character in single quotes (Next Frame: 'R'), then it will be triggered when that character is typed instead of when that key goes down. The difference is that typed keys will repeat after a delay.

On Mac the keyboard locale is not used for key down. 🙁 It is used for keys that are typed though. Eg, if you have a QWERTZ keyboard, when you press your Z key down it will be recognized as a Y. This sucks and the reasons I don't fix it is it's deep in the bowels of a project I don't control. Anyway, key typed events DO use the keyboard locale, so you can use eg, Undo: Ctrl + 'Z'.

Nate this is so awesome!!!
I didn't expect it to be this soon 🙂 :beer:
I have just tried to edit it and gotta say that even the format looks so good. Easy to understand & edit. Great job!

One thing - I'm not sure if I did something wrong or I've found a bug...
When I just swap shortcuts, for example W for X and X for W - it works.
But when I tried to add new ones, it doesn't work.
For example if I change W for DOT, It behaves like there were no hotkeys (spacebar doesnt work, or V,C and so on...)

...
Next Frame (10): ctrl + 'PAGE_DOWN'
Next Frame (10): ctrl + 'DOT'
Previous Frame: 'Z'
Previous Frame: 'COMMA'
Previous Frame: 'PAGE_UP'
Previous Frame (10): ctrl + 'COMMA'
...

And I didn't know about the "Save selection" & "Set selection" feature.
It's something I wanted to write a topic, now I don't need to. Huge timesaver, thanks!!!

Btw is the hotkeys config file top secret thingy or may I share it?
(I mean if it's not against the terms of use, sharing would be cool 🙂)

Woo! Finally get to swap R and F!

@Adam, check your spine.log and you'll see an error about which hotkeys are invalid. The reason is the single quotes are only for a single character. Eg: 'A' or 'Z' or '4'. Don't use single quotes when using named keys:

    ...
    Next Frame (10): ctrl + PAGE_DOWN
    Next Frame (10): ctrl + DOT
    Previous Frame: 'Z'
    Previous Frame: COMMA
    Previous Frame: PAGE_UP
    Previous Frame (10): ctrl + COMMA
    ...

Hotkey files can be shared, by all means! 🙂 If we come up with some common ones (eg like Maya or whatever app) we could even include multiple defaults in the settings dialog. Users could then just pick a default and be good to go.

I have tried to do it, my config still doesnt work 😃 I don't know why.

Here's the config:
http://pastebin.com/m2kBZspD
(I'll set up my git 😃 and I'll be posting the config there 🙂)

here's the spine log:

Spine Launcher 1.5.1-full
Licensed to: xxx
Mac OS X x86_64 10.8.5
Java 1.7.0_40 Oracle Corporation
Java HotSpot(TM) 64-Bit Server VM
Up to date: 1.6.18
Spine 1.6.18-full, JGLFW
ATI Technologies Inc.
AMD Radeon HD 6750M OpenGL Engine
2.1 ATI-1.8.19
Started.

I'll probably build it once again from the scratch, but still, it doesnt give me any error in log.
Any ideas? 🙂

Also:
When I press shortcut for "Previous frame" - it jumps 10 frames instead of 1 frame
Does it happen to you too?

Fixed previous frame, thanks!

I fixed some problems where it wasn't reporting the error in the hotkey file (oops). Your problem is that DOT is not a valid key name, use PERIOD instead. Your file works otherwise!

One thing I found is the single quote characters don't work with ctrl. Shift and alt work fine, but for control you can't use a single quoted character.

Brilliant! 🙂 I've changed DOT to PERIOD and it works.

I've noticed a new thing:
Ive got next / previous frame like this:

Next Frame: 'X'
Next Frame: PAGE_DOWN
Next Frame: PERIOD
Next Frame (10): ctrl + PAGE_DOWN
Next Frame (10): ctrl + PERIOD
Previous Frame: 'Z'
Previous Frame: COMMA
Previous Frame: PAGE_UP
Previous Frame (10): ctrl + COMMA
Previous Frame (10): ctrl + PAGE_UP

X/Z and ,/. works fine,
but PAGE_UP/PAGE_DOWN both do "Previous Frame (10)" action.

Also, maybe a bit different bug, but related to hotkeys - I'm on Mac and when I press hotkey ctrl(cmd) + anyKey (R... or whatever else)... I always hear the OS default error sound message.
I wasnt able to find the sound, its something like this 😃 http://www.youtube.com/watch?v=mRUnsFh8gag ...(not the whole song, but just one, like the first one in the video).
I can live with it, I dont even notice it anymore, but my colleagues tell me that its annoying if I have it on speakers 😃

Just few more ideas. To be able to set a hotkeys for:

Save project as...
...and all the menu options and toggle visibility of panels (Graph, Tree, Dopesheet...)

Loop Start
Loop End

Move playhead to Loop Start
Move playhead to Loop End

Now ctrl + LMB adds to selection. I'm used to shift + LMB. It would be nice to be able to add / change this key as well.

Toggle for Enable selecting bones
Toggle for Enable selecting images
Toggle for Enable selecting Bounding boxes

Toggle for Show bones
Toggle for Show images
Toggle for Show bounding boxes

Toggle for Show names of bones
Toggle for Show names of images
Toggle for Show names of bounding boxes

I'll come with more soon I guess 😃

...there are many shortcuts. Not all of those need to have a key assigned. It just would be great to have option to add a hotkey if we wanted to.

I pasted your hotkeys and page up/down worked as they should.

I'll look at why the Mac is making that sound. 🙁

I'll add some more hotkeys. Ctrl+click to add to selection probably won't be configurable though. The selection/tool system is already very complicated!

I fixed the beep sound on Mac in 1.6.20, released. I fixed the page up/down problem in 1.6.21, not yet released. 🙂

wohoooo I just wanted to write here that it's so awesome! I noticed! 🙂 😃
Thanks!!!!

1.6.21 is up. Keep in mind ctrl on Mac means the Apple key. 🙂 I couldn't live without KeyRemap4MacBook, personally.

works like a charm! 🙂
Yeah, the command key... I was pretty confused when I moved from win to mac 😃
That KeyRemap4MacBook looks cool, I'll check that out!
Thanks!

btw I was thinking about how it works if happens that you update the default hotkeys...

What i mean:

There is the file hotkeys.txt
I make a backup of it - hotkeysBackup.txt
I will modify hotkeys.txt to my needs.

But when you make an update in which you add ability to set a hotkey for a new feature, for example to "lock selected item" or to "set loop start" - what happens?
Will this be added to the hotkeys.txt?

I think that there could be another config file - hotkeysDefault.txt which would be always updated with a new update. It could be also used as a backup. New hotkeys for new features would come with the update.
The hotkeys.txt would stay untouched.

What do you think? 🙂 :coffee:

If you remove your hotkeys.txt, it will be replaced by the defaults. This is currently the only way to get new hotkeys. This is not good, because the hotkeys.txt is only replaced if it doesn't exist, so even users that haven't customized their hotkeys won't get new hotkeys. I guess it could append any hotkeys not defined in hotkeys.txt, using the default mapping. If the default mapping is already in use, it would add it without any mapping.

In 1.6.25+, hotkeys missing from the hotkeys.txt are added to the end of the appropriate section within the file. If you've removed or renamed a section, a new section is added to the end of the file.

Related to this, hotkeys can now have no key assigned, eg:


---

 General 

---


Undo: ctrl + Z
Instant Tooltips: 
Redo: ctrl + Y

This allows you to have no hotkey assigned to an action without causing the default hotkey to be inserted into your hotkey.txt file.

Also added a bunch of hotkeys, enjoy! 🙂 Uploading 1.6.25 now.

Wow that's really smart Nate! Thanks! 🙂