diff --git a/.gitignore b/.gitignore index 5e1422c..3bdc5ea 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md new file mode 100644 index 0000000..f2d3b67 --- /dev/null +++ b/ATTRIBUTION.md @@ -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 diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..770c874 --- /dev/null +++ b/appveyor.yml @@ -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 diff --git a/bin/build.bat b/bin/build.bat new file mode 100644 index 0000000..2a66333 --- /dev/null +++ b/bin/build.bat @@ -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% \ No newline at end of file diff --git a/res/keymash-black.png b/res/keymash-black.png new file mode 100644 index 0000000..df8ddb6 Binary files /dev/null and b/res/keymash-black.png differ diff --git a/res/keymash-white.png b/res/keymash-white.png new file mode 100644 index 0000000..9e92e6d Binary files /dev/null and b/res/keymash-white.png differ diff --git a/res/keymash.ico b/res/keymash.ico new file mode 100644 index 0000000..c9c03a1 Binary files /dev/null and b/res/keymash.ico differ diff --git a/res/keymash.xcf b/res/keymash.xcf new file mode 100644 index 0000000..0e4995d Binary files /dev/null and b/res/keymash.xcf differ diff --git a/src/GUI.ahk b/src/GUI.ahk new file mode 100644 index 0000000..a86b077 --- /dev/null +++ b/src/GUI.ahk @@ -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 diff --git a/src/KeyMash.ahk b/src/KeyMash.ahk new file mode 100644 index 0000000..1024404 --- /dev/null +++ b/src/KeyMash.ahk @@ -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 diff --git a/src/handlers/RapidFire.ahk b/src/handlers/RapidFire.ahk new file mode 100644 index 0000000..2b68d2a --- /dev/null +++ b/src/handlers/RapidFire.ahk @@ -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 +}