Skip to content

Commit

Permalink
Initial release; builds a working exe that only rapidfires 1 and 'e',…
Browse files Browse the repository at this point in the history
… and remaps mouse 4 to shift.
  • Loading branch information
pigsflew committed Oct 24, 2019
1 parent 307749d commit bd96734
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 50 deletions.
52 changes: 2 additions & 50 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,50 +1,2 @@
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

# Used by dotenv library to load environment variables.
# .env

## Specific to RubyMotion:
.dat*
.repl_history
build/
*.bridgesupport
build-iPhoneOS/
build-iPhoneSimulator/

## Specific to RubyMotion (use of CocoaPods):
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# vendor/Pods/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
out/
dist/
18 changes: 18 additions & 0 deletions ATTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
![CC][CC-Icon]![CC-BY][CC-BY-Icon]

The following files are provided with the below attribution:

* res/keymash-black.png
* res/keymash-white.png
* res/keymash.ico
* res/keymash.xcf

Created for [KeyMash](https://keymash.dev) by [Addie GS][1] using source material from *["274 Vector Solid Icons for free"](https://blog.fps.hu/274-vector-solid-icons-for-free/)* by Jaskó Ádám of [fps agency][2] is licensed under [CC BY 4.0][CC-BY]

These remixed icons are themselves licensed under [CC-BY 4.0][CC-BY] by [Addie GS][1], [fps agency][2], and Jaskó Ádám.

[CC-BY]: https://creativecommons.org/licenses/by/4.0/
[CC-ICON]: https://search.creativecommons.org/static/img/cc_icon.svg
[CC-BY-ICON]: https://search.creativecommons.org/static/img/cc-by_icon.svg
[1]: https://pigsflew.com
[2]: https://fps.hu
33 changes: 33 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: 1.0.{build}

branches:
only:
- master
- release

max_jobs: 1

environment:
AHK_PATH: C:\ahk\AutoHotkey.exe
AHK_DEBUG: true

install:
- ps: |
if (!(Test-Path ahk_install.exe)) {
echo "Downloading AHK installer"
appveyor DownloadFile https://github.com/Lexikos/AutoHotkey_L/releases/download/v1.1.30.01/AutoHotkey_1.1.30.01_setup.exe -FileName ahk_install.exe
} else {
echo "Using cached installer"
}
- ahk_install.exe /S /D=C:\ahk
- cmd: .\ci\install.bat

build_script:
- ./bin/build.bat

artifacts:
- name: dist
path: dist

cache:
- ahk_install.exe -> appveyor.yml
17 changes: 17 additions & 0 deletions bin/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@echo off
set err_level=0

IF EXIST dist ( del /s /f /q dist ) ELSE ( mkdir dist )
IF EXIST out ( del /s /f /q out ) ELSE ( mkdir out )

start "building" /B /wait "ahk2exe.exe" /ErrorStdOut /in ./src/KeyMash.ahk /out ./dist/KeyMash.exe /icon ./res/keymash.ico > ./out/buildoutput.txt 2>&1
echo ** Building src/KeyMash.ahk **
if errorlevel 1 (
echo *** Build failed ***
set err_level=1
)
type out/buildoutput.txt
echo.

rem EXIT SCRIPT
exit /b %err_level%
Binary file added res/keymash-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/keymash-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/keymash.ico
Binary file not shown.
Binary file added res/keymash.xcf
Binary file not shown.
9 changes: 9 additions & 0 deletions src/GUI.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#SingleInstance, Force
#KeyHistory, 0
SetBatchLines, -1
ListLines, Off
SendMode Input ; Forces Send and SendRaw to use SendInput buffering for speed.
SetTitleMatchMode, 3 ; A window's title must exactly match WinTitle to be a match.
SetWorkingDir, %A_ScriptDir%
SplitPath, A_ScriptName, , , , thisscriptname
#MaxThreadsPerHotkey, 1 ; no re-entrant hotkey handling
14 changes: 14 additions & 0 deletions src/KeyMash.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
; Include all our handlers & the GUI.
#Include, GUI.ahk
#Include, handlers/RapidFire.ahk

;TODO: Read Configuration; start GUI; iterate through configuration & kickoff handlers.



; Map keys to RapidFire.
~$e::RapidFire("e")
~$1::RapidFire(1)

; Remap the 4th mouse button to Shift.
XButton1::Shift
14 changes: 14 additions & 0 deletions src/handlers/RapidFire.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

RapidFire(key) {
KeyWait %key%, T0.5 ; Wait 500ms for user to release the pressed key
If ErrorLevel ; Still held down
If GetKeyState(key, "P"){
TrayTip, RapidFire Active, Firing '%key%',, 0x31
}
While GetKeyState(key, "P"){ ; While it is held down
Send %key%
Sleep 100
}
TrayTip
return
}

0 comments on commit bd96734

Please sign in to comment.