DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Help/question re creating a key sequence  (Read 17,808 times)

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
Help/question re creating a key sequence
« on: July 20, 2007, 12:23 AM »
Hi all,
I have an application that requres Alt+Shift+3 to activate.
Can I create a batch file that will perfrom this?
I'd like to put this in my quicklaunch bar, and click to activate.

thanks for any suggestions.

Barrett

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: Help/question re creating a key sequence
« Reply #1 on: July 20, 2007, 12:59 AM »
try this AHK code.. you need to put in the program's name, though.. :)

Code
#SingleInstance, force

Process, Exist,<program-name>.exe
If ErrorLevel <> 0
  Send, +!3     ;Alt+Shift+3
Return

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
Re: Help/question re creating a key sequence
« Reply #2 on: July 20, 2007, 04:31 PM »
Thanks for that...  but I have another quesion...  What about my useless function keys - is there a way to program a Function Key? (eg to do 'Alt Shift 3') ?

I'm sure a fancy keyboard could do this.. but I've got a plain old $10 model.
Seems like a waste to have those F keys since I hardly ever use them.

thanks again

jgpaiva

  • Artificial Idiocy
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • Cody Award
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Portugal Inhabitant
    • Linux User
Re: Help/question re creating a key sequence
« Reply #3 on: July 20, 2007, 08:50 PM »
Code
F5::!+3
That autohotkey code will remap your F5 to !(alt)+(shift)3 :D

For more info,just check here :)

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
Re: Help/question re creating a key sequence
« Reply #4 on: July 21, 2007, 07:36 AM »
Thanks... my autohotkey.ini file is below.  the first 2 lines are from the default ini that comes with a new install - should they be removed?  If I uncomment them AutoHotkey does not load.  The program (scrapture.exe) is working - when I press AltShift3 it does it's thing.  But the code below - when I press F5 does nothing.  I'm not a programmer and new to AutoHotkey - so I'm sure the problem is me... what do I need to change?  thanks

;#z::Run www.autohotkey.com
;^!n::
F5::!+3

jgpaiva

  • Artificial Idiocy
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • Cody Award
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Portugal Inhabitant
    • Linux User
Re: Help/question re creating a key sequence
« Reply #5 on: July 21, 2007, 09:15 AM »
When you uncomment them, ahk doesn't load because the second line has an error, it is incomplete.

Try this instead of the last line:
Code
F5::
  send,!+3
  return

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
Re: Help/question re creating a key sequence
« Reply #6 on: July 21, 2007, 10:45 AM »
Thanks again - but it also does not seem to work... (but manually pressing altshift3 still works)
Just to confirm - can the first 2 commented lines (leftover from installation default script) be deleted?
fyi  - the app is 'scrapture'  http://www.stereopsis.com/scrapture/
===================
;#z::Run www.autohotkey.com
;^!n::
F5::
  send,!+3
  return
===================
fyi - Output....
026: Return (3.00)
027: Send,!+3 (0.02)
028: Return (40.80)
027: Send,!+3 (0.02)
028: Return (53.75)

jgpaiva

  • Artificial Idiocy
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • Cody Award
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Portugal Inhabitant
    • Linux User
Re: Help/question re creating a key sequence
« Reply #7 on: July 21, 2007, 11:46 AM »
I wonder why that doesn't work. The keypresses are being sent correctly, so there should be no problem.
Yes, you can remove the first 2 lines, no problem.

Another variation:
Code
F5::
  send,{alt down}{shift down}3{shift up}{alt up}
  return

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
Re: Help/question re creating a key sequence
« Reply #8 on: July 21, 2007, 01:08 PM »
Does not work for me... does it work for you?

thanks much

jgpaiva

  • Artificial Idiocy
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • Cody Award
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Portugal Inhabitant
    • Linux User
Re: Help/question re creating a key sequence
« Reply #9 on: July 21, 2007, 04:17 PM »
Are you sure that you're not using altgr+shift+3 in the program?

(i can't test it, because i have no program that uses alt+shift+3 as a keystroke)

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
Re: Help/question re creating a key sequence
« Reply #10 on: July 21, 2007, 04:31 PM »
I am not sure what you mean by "altgr+shift+3v" but I press/hold the left Alt+ shift+3 keys and it works.
You can download the scrapture program - a tiny sreen capture tool - it is what requires AltShift3
http://www.stereopsis.com/scrapture/

thanks again

jgpaiva

  • Artificial Idiocy
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • Cody Award
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Portugal Inhabitant
    • Linux User
Re: Help/question re creating a key sequence
« Reply #11 on: July 21, 2007, 04:58 PM »
AltGR would be the right-alt. I was asking because altgr isn't really alt, it's alt+ctrl.
Ok, i'll try it too.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: Help/question re creating a key sequence
« Reply #12 on: July 22, 2007, 04:10 AM »
You can download the scrapture program - a tiny sreen capture tool - it is what requires AltShift3
http://www.stereopsis.com/scrapture/
why not use ScreenshotCaptor where the hotkeys are configurable to your liking?

[attach=#]
• http://www.donationcoder.com/Software/Mouser/screenshotcaptor/index.html

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
Re: Help/question re creating a key sequence
« Reply #13 on: July 22, 2007, 04:18 AM »
sure... I'll do that.  I am becoming more interested in 'why' altshiftkey did not work - just out of curiosity.  I'll try to learn a bit about autohotkey.... maybe there is a solution.
Screen Capture is not a problem - I have many capture programs.

thanks very much for your help!

Cuidado!

jgpaiva

  • Artificial Idiocy
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • Cody Award
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Portugal Inhabitant
    • Linux User
Re: Help/question re creating a key sequence
« Reply #14 on: July 22, 2007, 10:52 AM »
Interesting... I had never seen this. The problem must be in the screen capture program, that doesn't accept simulated keystrokes (which is which ahk send).

I've tested this with other apps that support custom hotkeys and had no problem.

Original address: https://www.donationcoder.com/forum/index.php?topic=9281.0