Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
always "on" command line
#1
Trying to create kind off 'command line shell for windows' so that I can control applications (IE) just by typing commands like 'back', 'forw', 'home' etc. I just hate mouse and alt and ctl shortcuts - prefer to keep my fingers on default row of keyboard.

So far I've had luck implementing it with inp function. Works fine. But that popup window is way too distractive. I'm thinking about some kind of inconspicuous text field tucked on taskbar or title of an active window. Then I would type shortcut it'd get focus and I'd type my command.

Any ideas how to start implementing this?

Thanks
#2
Function inp9. When launched, shows only small edit field instead of normal inp dialog. Assign some keyboard trigger, for example `. Press the trigger key(s) to show or activate the edit field. Then type a command and press Enter. Or, press Esc. Initially this function has four sample commands - back, forw, run and act. Similarly you can add more commands.

back and forw can be used with browser.
act activates a window. For example, command act notepad activates Notepad window.
run launches a program. For example, command run notepad launches notepad.

Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(getopt(nthreads)>1) act "inp9"; ret

str controls = "3"
str e3
if(!ShowDialog("inp9" &inp9 &controls)) ret
rep(100) if(win) break; else 0.02

spe -2
sel e3 1
,case "back": key AL
,case "forw": key AR
,case else
,if(e3.begi("run")) e3.gett(e3 1); run e3; err
,else if(e3.begi("act"))
,,e3.gett(e3 1)
,,if(e3.len) act win(e3 "" "" 2); err
,,else act; err

;BEGIN DIALOG
;0 "" 0x90000246 0x88 0 0 96 14 "inp9"
;3 Edit 0x54030080 0x204 0 0 96 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010703 "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam)
,mov ScreenWidth/2-80 0 hDlg
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1


Forum Jump:


Users browsing this thread: 1 Guest(s)