Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/davebrny/long-press

long press a key to send an alternate key, symbol or string
https://github.com/davebrny/long-press

autohotkey productivity windows

Last synced: 16 days ago
JSON representation

long press a key to send an alternate key, symbol or string

Awesome Lists containing this project

README

        

# Long Press

 

**Type symbols without having to use the shift key:**

`long press =`   `--->`   `+`

`long press /`   `--->`   `?`

**Type [unicode](https://en.wikipedia.org/wiki/List_of_Unicode_characters) characters:**

`long press a`   `--->`   `á`

`long press b`   `--->`   `•`

`long press y`   `--->`   `✔`

**Paste longer strings of text:**

`long press e`   `--->`   `[email protected]`

```
long press t --->

Yours Sincerely
your_name
```

 

## Usage

When you first run the script the active key list will be [example.ini](https://github.com/davebrny/long-press/blob/master/example.ini). You can use that file or create a new ini key list as long as it's kept in the same folder.

> (You can download my key list [here](https://gist.github.com/davebrny/ec0b107973cce88217ed14d6183e52ab) and use that as a starting point either)

The section name has to be called `[long press]` and you will need to change the value of `active_list` in [settings.ini](https://github.com/davebrny/long-press/blob/master/settings.ini) to match the name of the new ini file that you want to use.

 

```autohotkey
[ini format example]
ini key = ini value ; comments are allowed here

/ = {?} ; send an alternate key
b = {U+2022} ; send unicode
e = [email protected] ; send a string
```

Any comments that are at the end of the line will be stripped out when the script runs.
There is also no need to use the escape character if the ini key name is `[` or `;`

If there are duplicate keys then the last one in the list is the one that will be used:

```
f = F
f = {U+261B}
```

To temporarily disable the long press action for a key, put a semi-colon at the start of the ini value. Leaving the ini value blank will have the same effect.

```
8 = ; {*}
8 =
```

 

### Long press duration

The default duration to trigger a long press is between 240 and 500 milliseconds. If you end up triggering long presses without meaning to then try increasing the `press_duration` in the settings file to 260 or 280 until you find a time that suits. If the key is held down for longer the 500 it will start to spammmmmmmm as normal, but that time may also need to be adjusted depending what system or hardware you're using.

 

**Some notes:**

The keys that work best with long pressing are keys that send a character such as `a-z`, `0-9` or any of the symbol keys. Keys like `escape`, `pgUp` or `pause` wont work that well (or at all) unless they are used in conjunction with some other commands. (See the commands.ahk file for an example of how `backspace` and `delete` are used)

`long press backspace`   `--->`   delete the whole word instead of just one character

`long press enter`   `--->`   make a new line before the current line instead of after it

Some hotkeys like ctrl + f can be sent but not all will work either so some trial and error might be needed.

`long press f`   `--->`   send ctrl + f