Compare commits

...

3 commits

Author SHA1 Message Date
5ed33d7d80 Modified README.md
Modified README.md

Modified README.md
2023-07-02 18:02:57 +02:00
f24dddb381 Deprecated scripts moved aside 2023-07-02 16:13:21 +02:00
5707c7746e mausuHoldo & piusareLite: slight cleanup / title added 2023-07-02 16:08:42 +02:00
9 changed files with 124 additions and 40 deletions

4
.gitignore vendored Normal file
View file

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

View file

@ -1,25 +1,79 @@
AHK script para hacer el payaso con el teclado. Collection of useful scripts for keyboard remappings and mouse operation without modifying keyboard language or system locale.
## Guia # Keyboard Remappings - piusareLite.ahk
**Activar/Desactivar con CapsLock:** Set of key bindings meant for the ANSI US layout set to:
- H,J,K,L-LEFT, DOWN, UP, RIGHT - Facilitate the usage of spanish tilde keys without depending on a dead key.
- P,O-PGUP, PGDN - Remap modifier keys to accomodate a comfyer usage.
- I,U-ctrl+X, ctrl+C - Toggle `Caps Lock` with both Shift keys.
- Ñ-ctrl+V
- M-F2
- ,-F8
- N-ctrl+Z
- Y-ctrl+Y
- `-Del
- +-Home
- ç-End
- ´-Ins
- F-CTRL ## How to use
- S-SHIFT
- A-Alt - While holding `Left Alt`:
- E-ctrl+S - Press on any of the spanish vowel keys `(a, e, i, o, u)` to write their accented representation `(á, é, í, ó, ú)`.
- D-Esc - You can also write the Euro sign `€` pressing `p`, the umlaut u `ü` pressing `/` and the `ñ` with `n`.
- C-ctrl+F, ctrl+H con S+F simultáneo - Press both `Shift` keys to toggle `Caps Lock`.
- `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.36.02` 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 @@
;;TODO: comprobar puntero en local ;;KBD D events stop execution, so _H it is.
;; 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 )
;;WINDOOOOOOOOOOOOOOOOOOOOOOOOOOOOOWS y ahk unaware del futuro de los escritorios ;;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")
@ -103,6 +103,7 @@ RAlt & LAlt::
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
@ -157,8 +158,9 @@ h::
;;SendInput, {RCtrl Down} ;;SendInput, {RCtrl Down}
return return
;;tuckaway ;;Tuck away
;;targeting 1080p displays with taskbar on top. Should adapt to any single monitor setup. ;;TODO: comprobar puntero en local
;;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 )

21
old/howto-piusareLED.txt Normal file
View file

@ -0,0 +1,21 @@
**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,7 +1,8 @@
;;TODO: GAMER MODE (lctrl toggle) ;;Use on admin windows without admin rights:
;; alt+spacebar liandola ;;https://www.autohotkey.com/docs/v1/Program.htm#Installer_uiAccess
;; ;;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
@ -25,7 +26,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,2 +1,4 @@
START /B "C:\Program Files\AutoHotkey\AutoHotkey.exe" "D:\Contenido\Capybara\Cositas\piusare\mausu.ahk" @pushd %~dp0
START /B "C:\Program Files\AutoHotkey\AutoHotkey.exe" "D:\Contenido\Capybara\Cositas\piusare\piusareLite.ahk" START /B MouseOnKeyboard.exe
START /B KeyboardRemappings.exe
@popd