keyboard shortcuts

Got an idea for something that SharpCap should do? Share it here.
Forum rules
'+1' posts are welcome in this area of the forums to indicate your support for a particular feature suggestion. Suggestions that get the most +1's will be seriously considered for inclusion in future versions of SharpCap.
mKoch
Posts: 28
Joined: Mon Sep 04, 2017 8:58 am

Re: keyboard shortcuts

#11

Post by mKoch »

The new USB keyboard is ready. I did use the electronics from a very cheap chinese keyboard, threw away the original keys and replaced the F1..F12 keys by 33mm diameter illuminated pushbuttons (very cheap from AliExpress). The spacing between the buttons is 60mm, that's big enough to hit the buttons with gloves. Some SharpCap functions can already be accessed from this keyboard via AutoHotKey: Quick Start, Stop, Histogram on/off, Focus Assistant on/off. It's also possible to make an audio feedback in AutoHotKey. Two different tones for Start and Stop.

Michael

Image
Image
mKoch
Posts: 28
Joined: Mon Sep 04, 2017 8:58 am

Re: keyboard shortcuts

#12

Post by mKoch »

Below is the AutoHotKey script. The simulated mouse clicks for exposure and gain aren't a good solution, because the x position depends on the width of the control panel, and the y position changes when the camera profiles section is folded in or out. We really need keyboard shortcuts for these functions. And the gain step size should be smaller than 50, I think 10 would be fine.

Michael

Code: Select all

#IfWinActive SharpCap
F1::                        ; 
  MouseClick,left,1051,65   ; Zoom  
  MouseClick,left,1030,85   ; Auto
  return
F2::                        ; 
  MouseClick,left,1051,65   ; Zoom  
  MouseClick,left,1030,310  ; 300% 
  return
F3::                        ;
  MouseClick,left,1457,346  ; Exposure -   
  return
F4::                        ; 
  MouseClick,left,1918,346  ; Exposure +   
  return
F5::                        ; unused
  MsgBox,,,F5,2             ;
  return
F6::                        ; unused
  MsgBox,,,F6,2             ;
  return
F7::                        ; 
  MouseClick,left,1539,412  ; Gain -   
  return
F8::                        ; 
  MouseClick,left,1853,412  ; Gain + 
  return
F9::                        ; Histogram on/off   
  send,!t h                 ; Alt-t h
  return
F10::                       ; Focus Assistant on/off   
  send,!t f {Enter}         ; Alt-t f Enter 
  return
F11::                       ; Quick Start
  send, !q                  ; Alt-q 
  SoundBeep,1000,200        ; Beep high 
  return
F12::                       ; Stop Capture  
  send, {esc}               ; Escape
  SoundBeep,500,200         ; Beep low
  return
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: keyboard shortcuts

#13

Post by admin »

That's very impressive! I have the keyboard shortcuts on the feature list for the next version.

cheers,

Robin
mKoch
Posts: 28
Joined: Mon Sep 04, 2017 8:58 am

Re: keyboard shortcuts

#14

Post by mKoch »

Updated AutoHotKey script for use with SharpCap 3.1.5164 which has keyboard shortcuts for Exposure +- and Gain +-
It's working perfecly now. Thank you very much!
Michael

Code: Select all

#IfWinActive SharpCap
F1::                        ; 
  MouseClick,left,1051,65   ; Zoom  
  MouseClick,left,1030,85   ; Auto
  MouseMove 1600,50         ; Move the mouse out of the picture
  return
F2::                        ; 
  MouseClick,left,1051,65   ; Zoom  
  MouseClick,left,1030,310  ; 300% 
  MouseMove 1600,50         ; Move the mouse out of the picture
  return
F3::                        ;
  send,{F1}                 ; Exposure -   
  return
F4::                        ; 
  send,{F2}                 ; Exposure +   
  return
F5::                        ; unused
  MsgBox,,,F5,2             ;
  return
F6::                        ; unused
  MsgBox,,,F6,2             ;
  return
F7::                        ; 
  send,{F3}                 ; Gain -   
  return
F8::                        ; 
  send,{F4}                 ; Gain + 
  return
F9::                        ; Histogram on/off   
  send,!t h                 ; Alt-t h
  return
F10::                       ; Focus Assistant on/off   
  send,!t f {Enter}         ; Alt-t f Enter 
  return
F11::                       ; Quick Start
  send, !q                  ; Alt-q 
  SoundBeep,1000,200        ; Beep high 
  return
F12::                       ; Stop Capture  
  send, {esc}               ; Escape
  SoundBeep,500,200         ; Beep low
  return
User avatar
admin
Site Admin
Posts: 13173
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: keyboard shortcuts

#15

Post by admin »

Hi,

never tried this, but I suspect that something along the lines of

Code: Select all

if WinActive("ahk_exe SharpCap.exe")
might be the right approach (see https://autohotkey.com/docs/misc/WinTitle.htm and https://autohotkey.com/docs/commands/WinActive.htm)

Robin
mKoch
Posts: 28
Joined: Mon Sep 04, 2017 8:58 am

Re: keyboard shortcuts

#16

Post by mKoch »

I didn't find a working example for
if WinActive(...)

However this code is working as expected:
#IfWinActive SharpCap

Michael
mKoch
Posts: 28
Joined: Mon Sep 04, 2017 8:58 am

Re: keyboard shortcuts

#17

Post by mKoch »

Post Reply