Author Topic: Type an en dash into the active window  (Read 1861 times)

netkingcol

  • Newbie
  • *
  • Posts: 28
Type an en dash into the active window
« on: July 05, 2019, 08:55:11 AM »
I'm writing in the Inara logbooks and would find it very convenient to make a single keypress to insert an en dash.

I know that typing Ctrl+Alt+[Num -] followed by Alt+0150 on the numeric keypad does the trick but putting the following lines in a VA command seems to do nothing.

Code: [Select]
Press Left Ctrl+Left Alt+NumPad Subtract keys and hold for 0.05 seconds and release
Press Left Alt+NumPad 0 keys and hold for 0.05 seconds and release
Press Left Alt+NumPad 1 keys and hold for 0.05 seconds and release
Press Left Alt+NumPad 5 keys and hold for 0.05 seconds and release
Press Left Alt+NumPad 0 keys and hold for 0.05 seconds and release

Has anyone found a way to do this?

netkingcol

  • Newbie
  • *
  • Posts: 28
Re: Type an en dash into the active window
« Reply #1 on: July 05, 2019, 09:16:30 AM »
I've also tried this sequence, recorded using the Recorder option.

Code: [Select]
Press down Left Ctrl key
Press down Left Alt key
Press NumPad Subtract key and hold for 0.01 seconds and release
Pause 0.01 seconds
Release Left Alt key
Pause 0.01 seconds
Release Left Ctrl key
Pause 0.01 seconds
Press down Left Alt key
Pause 0.01 seconds
Press NumPad 0 key and hold for 0.01 seconds and release
Pause 0.01 seconds
Press NumPad 1 key and hold for 0.01 seconds and release
Pause 0.01 seconds
Press NumPad 5 key and hold for 0.01 seconds and release
Pause 0.01 seconds
Press NumPad 0 key and hold for 0.01 seconds and release
Pause 0.01 seconds
Release Left Alt key

This works when I execute it in the profile editor, but not when I use the shortcut.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Type an en dash into the active window
« Reply #2 on: July 05, 2019, 09:25:07 AM »
This sequence seems to work as it represents exactly how the sequence should occur if you type it by hand:

Press down Left Alt key
Press NumPad 0 key and hold for 0.1 seconds and release
Press NumPad 1 key and hold for 0.1 seconds and release
Press NumPad 5 key and hold for 0.1 seconds and release
Press NumPad 0 key and hold for 0.1 seconds and release
Release Left Alt key

The timings should be modified to suit your need.

I have it on the list to add unicode character output to Quick Input for a later release.

netkingcol

  • Newbie
  • *
  • Posts: 28
Re: Type an en dash into the active window
« Reply #3 on: July 05, 2019, 09:33:34 AM »
Yes, brilliant, thank you!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Type an en dash into the active window
« Reply #4 on: July 05, 2019, 06:35:07 PM »
If the application you're typing into supports pasting from the clipboard, that's another option you can try, with fewer keystrokes (and thus time) required:
Code: [Select]
Set Windows clipboard to '–'
Press Left Ctrl+V keys and hold for 0,01 seconds and release

netkingcol

  • Newbie
  • *
  • Posts: 28
Re: Type an en dash into the active window
« Reply #5 on: July 06, 2019, 02:53:18 AM »
Thank you, I'll try that because there does seem to be a slight delay. However, I do use the clipboard a lot for image URLs and moving text around, so I'll have to be more 'clipboard-aware', then I'll know what's saved there and what I'm about to paste. It's a good tip, though, and I'm sure I'll find additional uses.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Type an en dash into the active window
« Reply #6 on: July 06, 2019, 07:19:02 AM »
If there's text (only text, not files or VoiceAttack actions, etc...) in the clipboard you want to keep, you can store the current contents of the clipboard before overwriting them, and put them back after pasting:
Code: [Select]
Set Text [~clipBoardContents] to '{CLIP}'
Set Windows clipboard to '–'
Press Left Ctrl+V keys and hold for 0,01 seconds and release
Set Windows clipboard to '{TXT:~clipBoardContents}'

netkingcol

  • Newbie
  • *
  • Posts: 28
Re: Type an en dash into the active window
« Reply #7 on: July 07, 2019, 05:40:05 AM »
Codified cleverness!  8)