Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 09, 2016, 11:36:50 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Help/question re creating a key sequence  (Read 7822 times)

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
    • View Profile
    • Donate to Member
Help/question re creating a key sequence
« on: July 19, 2007, 07:23:41 PM »
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,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #1 on: July 19, 2007, 07:59:24 PM »
try this AHK code.. you need to put in the program's name, though.. :)

#SingleInstance, force

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

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
    • View Profile
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #2 on: July 20, 2007, 11:31:48 AM »
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

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #3 on: July 20, 2007, 03:50:33 PM »
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
    • View Profile
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #4 on: July 21, 2007, 02:36:26 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

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #5 on: July 21, 2007, 04:15:17 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:
F5::
  send,!+3
  return

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
    • View Profile
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #6 on: July 21, 2007, 05:45:23 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

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #7 on: July 21, 2007, 06:46:24 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:
F5::
  send,{alt down}{shift down}3{shift up}{alt up}
  return

222fbj

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

thanks much

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #9 on: July 21, 2007, 11:17:04 AM »
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
    • View Profile
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #10 on: July 21, 2007, 11:31:17 AM »
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

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #11 on: July 21, 2007, 11:58:42 AM »
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,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #12 on: July 21, 2007, 11:10:14 PM »
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?

ws-SC-hotkeys.png
http://www.donationc...hotcaptor/index.html


222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
    • View Profile
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #13 on: July 21, 2007, 11:18:21 PM »
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

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Help/question re creating a key sequence
« Reply #14 on: July 22, 2007, 05:52:04 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.