Compare commits

..

No commits in common. "c6b81ae72e570864b78c1a9db07c782a1149fc7b" and "b64dbc05a1bb6956612dac5b058540805e15aa00" have entirely different histories.

9 changed files with 40 additions and 124 deletions

4
.gitignore vendored
View file

@ -1,4 +0,0 @@
*.exe
temp*
*.lnk
build/

View file

@ -1,79 +1,25 @@
Collection of useful scripts for keyboard remappings and mouse operation without modifying keyboard language or system locale. AHK script para hacer el payaso con el teclado.
# Keyboard Remappings - piusareLite.ahk ## Guia
Set of key bindings meant for the ANSI US layout set to: **Activar/Desactivar con CapsLock:**
- Facilitate the usage of spanish tilde keys without depending on a dead key. - H,J,K,L-LEFT, DOWN, UP, RIGHT
- Remap modifier keys to accomodate a comfyer usage. - P,O-PGUP, PGDN
- Toggle `Caps Lock` with both Shift keys. - I,U-ctrl+X, ctrl+C
- Ñ-ctrl+V
- M-F2
- ,-F8
- N-ctrl+Z
- Y-ctrl+Y
- `-Del
- +-Home
- ç-End
- ´-Ins
## How to use - F-CTRL
- S-SHIFT
- While holding `Left Alt`: - A-Alt
- Press on any of the spanish vowel keys `(a, e, i, o, u)` to write their accented representation `(á, é, í, ó, ú)`. - E-ctrl+S
- You can also write the Euro sign `€` pressing `p`, the umlaut u `ü` pressing `/` and the `ñ` with `n`. - D-Esc
- Press both `Shift` keys to toggle `Caps Lock`. - C-ctrl+F, ctrl+H con S+F simultáneo
- `Caps Lock` key acts as another `Left Control`.
- `Left Alt` **must** be released before inputting another macro character in order to prevent writing multiple, unintended macro characters when typing quickly.
## Compilation
Usage of this script requires the latest version of **AutoHotKey v1** (`1.1.37.01`, TODO as of writing) with Unicode support, readily available on the project's page. It is also tested on **AutoHotKey_H v2**.
Alternatively, you can compile the script using the built-in compiler distributed with **AutoHotKey v1** or **AutoHotKey_H v2** with `v1` binary:
```
Ahk2Exe.exe /in piusareLite.ahk /out KeyboardMappings.exe
```
# Mouse On Keyboard - mausuHoldo.ahk
Keyboard layer that allows cursor interaction using only the keyboard itself. This script allows you to:
- Move, click and hold.
- Change between two speeds.
- Hide cursor with a single keystroke.
## How to use
Assuming an ANSI US keyboard:
- Enable and disable by pressing both `Alt` keys.
- Move your cursor around by holding `j`, `k`, `l` and `;`.
- Press `u` for `Single Left Mouse Click`, `i` for `Single Middle Mouse Click` and `o` for `Single Right Mouse Click`.
- Press `/` for `Mouse 4` and `p` for `Mouse 5`.
- Press `y` for `Scroll Up` and `n` for `Scroll Down`.
- Press `n` to `Hold Left Mouse Click`, `,` to `Hold Middle Mouse Click` and `.` to `Hold Right Mouse Click`. Pressing both these keys or their respective `Single` variants will let go.
- Press `h` or `'` to change between cursor speeds.
- Press `[` to hide cursor.
## Compilation
Usage of this script requires **AutoHotKey_H v2** with Unicode support due to it's reliance on multi threading. AutoHotKey_H v2 is available on its project's page.
Alternatively, you can compile the script using the built-in compiler distributed with **AutoHotKey_H v2** with `v1` binary:
```
Ahk2Exe.exe /in mausuHoldo.ahk /out MouseOnKeyboard.exe
```
## False positive
Windows Defender flags this script as malicious on some devices. Dealing with that would require submitting a single, compile executable for MicroSoft to manually review and approve, and I'm not interested in dealing with all that.
# Use on administrator-owned windows
These scripts, as they stand, require elevated privileges to work within privileged windows when UAC is active due to system restrictions. Adding and testing the code required to circumvent this limitation not only would make the scripts even more unwieldy, but also woulnd't overcome all the restrictions imposed by UAC. As such, it is recommended to run these scripts as adminsitrator. A batch file is included alongside releases to facilitate this, which can be added to a scheduled task so that it is done automatically on log in.
# Bonus
- `mausu.ahk` is preserved as the flawed, single-threaded variand of `mausuHoldo.ahk`.
- `cmah.ahk` served its purpose: ripping some sprites from a NeoGeo game using a web-based memory watcher.
- `piusareLED.ahk` has code to light up your keyboard's lights! Kinda cool if you wanna set up some sort of visual alert. Also, it was designed to be a much more thorough key layer, meant to be used with whatever text editor, messaging app or whatever program you wanted. A text file vaguely detailing how to used is provided alongside it.
# External Links
- [AutoHotKey_H](https://hotkeyit.github.io/v2/)
- [How to activate UIA for Admin Rights when installing AutoHotKey](https://www.autohotkey.com/docs/v1/Program.htm#Installer_uiAccess)
- [Code to give a script uiAccess rights](https://www.autohotkey.com/board/topic/70449-enable-interaction-with-administrative-programs/)

View file

@ -1,7 +1,7 @@
;;KBD D events stop execution, so _H it is. ;;TODO: comprobar puntero en local
;; ugly af lo de flagear para compartir un sincro sin sincro, bro. no creo que lo cambie xddd
Menu, Tray, Tip, Mouse On Keyboard ;;
;;eveentos down del teclado no paraban de joder porque paraban el unico hilo, so _h it was, its threading time
#MaxThreadsPerHotkey 2 #MaxThreadsPerHotkey 2
#HotkeyInterval 10000 #HotkeyInterval 10000
#MaxHotkeysPerInterval 9999 #MaxHotkeysPerInterval 9999
@ -16,7 +16,7 @@ screenXExtraFactor := 1.02
screenYExtraFactor := 0.10 screenYExtraFactor := 0.10
;;DllCall("mouse_event", "UInt", 1, "UInt", (rightMov + lefMov) , "UInt", upMov + downMov ) ;;DllCall("mouse_event", "UInt", 1, "UInt", (rightMov + lefMov) , "UInt", upMov + downMov )
;;AHK unaware del futuro de los escritorios. ;;WINDOOOOOOOOOOOOOOOOOOOOOOOOOOOOOWS y ahk unaware del futuro de los escritorios
;;https://www.autohotkey.com/boards/viewtopic.php?t=97706 ;;https://www.autohotkey.com/boards/viewtopic.php?t=97706
DllCall("SetThreadDpiAwarenessContext", "ptr", -3, "ptr") DllCall("SetThreadDpiAwarenessContext", "ptr", -3, "ptr")
@ -102,8 +102,7 @@ RAlt & LAlt::
updateRate := Floor(updateRate / ticksPerSecond) updateRate := Floor(updateRate / ticksPerSecond)
currentTime := currentTime ;;/ 1.0 currentTime := currentTime ;;/ 1.0
baseTime := baseTime ;;/ 1.0 baseTime := baseTime ;;/ 1.0
;;This do be Ugly AF. Probably gonna stay this way.
obj := CriticalObject(A_Args[1]) obj := CriticalObject(A_Args[1])
lefMov := obj.lefMov lefMov := obj.lefMov
@ -158,9 +157,8 @@ h::
;;SendInput, {RCtrl Down} ;;SendInput, {RCtrl Down}
return return
;;Tuck away ;;tuckaway
;;TODO: comprobar puntero en local ;;targeting 1080p displays with taskbar on top. Should adapt to any single monitor setup.
;;Targeting 1080p displays with taskbar on top. Should adapt to any single monitor setup.
sc01A:: sc01A::
;;y:: ;;y::
;;DllCall("ShowCursor", "Int", slowDown ) ;;DllCall("ShowCursor", "Int", slowDown )

View file

@ -1,21 +0,0 @@
**Toggle with Caps Lock:**
- H,J,K,L-LEFT, DOWN, UP, RIGHT
- P,O-PGUP, PGDN
- I,U-ctrl+X, ctrl+C
- ;‘-ctrl+V
- M-F2
- ,-F8
- N-ctrl+Z
- Y-ctrl+Y
- `-Del
- +-Home
- \-End
- '-Ins
- F-CTRL
- S-SHIFT
- A-Alt
- E-ctrl+S
- D-Esc
- C-ctrl+F, ctrl+H with simultaneous S+F

View file

@ -1,8 +1,7 @@
;;Use on admin windows without admin rights: ;;TODO: GAMER MODE (lctrl toggle)
;;https://www.autohotkey.com/docs/v1/Program.htm#Installer_uiAccess ;; alt+spacebar liandola
;;https://www.autohotkey.com/board/topic/70449-enable-interaction-with-administrative-programs/ ;;
;;Use on admin windows without admin rights: https://www.autohotkey.com/docs/v1/Program.htm#Installer_uiAccess
Menu, Tray, Tip, Keyboard Remappings
#SingleInstance Force #SingleInstance Force
#MaxHotkeysPerInterval 9999 #MaxHotkeysPerInterval 9999
hotkeyLock := 0 hotkeyLock := 0
@ -26,7 +25,7 @@ sendCheckCapsLock(command, clCommand)
CapsLock::LControl CapsLock::LControl
RShift & LShift::CapsLock RShift & LShift::CapsLock
LShift & RShift::CapsLock LShift & RShift::CapsLock
;;LCtrl::AppsKey LCtrl::AppsKey
;;*CapsLock::return ;;*CapsLock::return
return return

View file

@ -1,4 +1,2 @@
@pushd %~dp0 START /B "C:\Program Files\AutoHotkey\AutoHotkey.exe" "D:\Contenido\Capybara\Cositas\piusare\mausu.ahk"
START /B MouseOnKeyboard.exe START /B "C:\Program Files\AutoHotkey\AutoHotkey.exe" "D:\Contenido\Capybara\Cositas\piusare\piusareLite.ahk"
START /B KeyboardRemappings.exe
@popd