Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Nov 17, 2013
0 parents commit 7625c27
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.sublime-*
*.exe
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Lib/dual"]
path = Lib/dual
url = https://github.com/lydell/dual.git
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2013 Simon Lydell

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
1 change: 1 addition & 0 deletions Lib/dual
Submodule dual added at d2d2be
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Changelog
=========

Version 0.1.0 (Unreleased)
--------------------------

Initial release.
59 changes: 59 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Overview
========

spacefn-win is an implementation of the [SpaceFN] keyboard layout by spiceBar. It is an [AutoHotkey]
script.


Installation
============

There are two different ways to go.

The simplest option is to download the compiled file spacefn-win.exe and run it. No installation
required.

The other option is to install [AutoHotkey] 1.1.13.00+ (if you haven't already), download the whole
project and runt the spacefn-win.ahk file using AutoHotkey. Use this option if you're already using
AutoHotkey or want to customize the layout.

Either way, put a shortcut to spacefn-win.(ahk|exe) in the Autostart folder to activate the layout
automatically when you log in to your computer. (It won't work in the login screen.)


Command-line options
====================

The script accepts any number of command line options of the form `option=value`. The following
options are available:

- `swap_backtick_escape`: `true` or `false` (default)
- [`delay`, `timeout` and `doublePress`][dual-config]: Integer (advanced)

Examples:

- `autohotkey spacefn-win.ahk delay=70 swap_backtick_escape=true`
- `spacefn-win.exe delay=70 swap_backtick_escape=true`


Notes
=====

The script assumes that you're using the en-US QWERTY layout. If you're using some other layout, you
unfortunately might have to modify the script. It should be pretty straight-forward, though. Don't
hesitate to ask for help with this, if needed. If you find a way to make the script layout-agnostic,
please tell me!

The [SpaceFN] post mentions a gaming mode. As far as I'm concerned, using AHK and games at the same
time is not such a good idea.


License
=======

[MIT Licensed](LICENSE)


[AutoHotkey]: http://autohotkey.com/
[dual-config]: https://github.com/lydell/dual#configuration
[SpaceFN]: #
77 changes: 77 additions & 0 deletions spacefn-win.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
; Note: This implementation assumes an en-US QWERTY layout.


SendMode Input
#NoEnv
#SingleInstance force


options := {delay: 150, timeout: 300, doublePress: -1, swap_backtick_escape: false}
loop %0% {
arg := %A_Index%
argSplit := StrSplit(arg, "=")
option := argSplit[1]
value := argSplit[2]
options[option] := value
}


#Include <dual/dual>
dual := new Dual


#Include <dual/defaults>


#If options.swap_backtick_escape
*`::dual.comboKey({F22: "Escape"})
#If


#If true ; Override defaults.ahk. There will be "duplicate hotkey" errors otherwise.

*Space::
*Space UP::dual.combine("F22", A_ThisHotkey, {delay: options.delay, timeout: options.timeout, doublePress: options.doublePress})

*i::dual.comboKey({F22: "Up"})
*j::dual.comboKey({F22: "Left"})
*k::dual.comboKey({F22: "Down"})
*l::dual.comboKey({F22: "Right"})

*u::dual.comboKey({F22: "Home"})
*o::dual.comboKey({F22: "End"})
*h::dual.comboKey({F22: "PgUp"})
*n::dual.comboKey({F22: "PgDn"})

*BackSpace::dual.comboKey({F22: "Delete"})

*\::dual.comboKey({F22: "Insert"})

*b::dual.comboKey({F22: "Space"})

*1::dual.comboKey({F22: "F1"})
*2::dual.comboKey({F22: "F2"})
*3::dual.comboKey({F22: "F3"})
*4::dual.comboKey({F22: "F4"})
*5::dual.comboKey({F22: "F5"})
*6::dual.comboKey({F22: "F6"})
*7::dual.comboKey({F22: "F7"})
*8::dual.comboKey({F22: "F8"})
*9::dual.comboKey({F22: "F9"})
*0::dual.comboKey({F22: "F10"})
*-::dual.comboKey({F22: "F11"})
*=::dual.comboKey({F22: "F12"})

*p::dual.comboKey({F22: "PrintScreen"})
*[::dual.comboKey({F22: "ScrollLock"})
*]::dual.comboKey({F22: "Pause"})

*/::dual.comboKey({F22: "AppsKey"})

*m::dual.comboKey({F22: "``"})
*,::dual.comboKey({F22: "~"})

*e::dual.comboKey({F22: "Escape"})
*`::dual.comboKey("Escape", {F22: "``"})

#If

0 comments on commit 7625c27

Please sign in to comment.