Page 2 of 2

Re: keyboard shortcuts

Posted: Sat Apr 14, 2018 8:50 am
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

Re: keyboard shortcuts

Posted: Sat Apr 14, 2018 1:16 pm
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

Re: keyboard shortcuts

Posted: Sat Apr 14, 2018 1:54 pm
by admin
That's very impressive! I have the keyboard shortcuts on the feature list for the next version.

cheers,

Robin

Re: keyboard shortcuts

Posted: Mon Apr 30, 2018 5:17 pm
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

Re: keyboard shortcuts

Posted: Mon Apr 30, 2018 5:33 pm
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

Re: keyboard shortcuts

Posted: Mon Apr 30, 2018 5:50 pm
by mKoch
I didn't find a working example for
if WinActive(...)

However this code is working as expected:
#IfWinActive SharpCap

Michael

Re: keyboard shortcuts

Posted: Mon Apr 30, 2018 5:57 pm
by mKoch