Welcome Guest.   Make a donation to an author on the site July 29, 2014, 01:40:43 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2012! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Request. Add feature to the free program  (Read 7268 times)
plander
Participant
*
Posts: 8


View Profile Give some DonationCredits to this forum member
« on: July 17, 2012, 12:35:42 PM »

Hi. I use a program, called AltDrag, this program very good, but haven't 1 useful thing - i can't drag windows by pressing only middle mouse button, they can drag windows by combinations alt or ctrl + mouse button, but drag windows by only middle button, without alt or ctrl this program can't. I talk with author, but he say that he haven't time to add this feature and say that i can add by myself, it's free source code, but i don't know coding, but want this feature very much Sad

Pls someone can add this feature to this program? or in irc guys give me some script, but he can't drag only by middle mouse button to, may be u can edit this script or add feature to the program?
Logged
skwire
Moderator
*****
Posts: 4,021



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: July 17, 2012, 01:05:53 PM »

or in irc guys give me some script, but he can't drag only by middle mouse button to, may be u can edit this script or add feature to the program?

Hi, plander, and welcome to DonationCoder.  Here is a modified version of the AHK script that should do what you requested:

Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. ~MButton::
  2. CoordMode, Mouse  ; Switch to screen/absolute coordinates.
  3. MouseGetPos, EWD_MouseStartX, EWD_MouseStartY, EWD_MouseWin
  4. WinGetPos, EWD_OriginalPosX, EWD_OriginalPosY,,, ahk_id %EWD_MouseWin%
  5. WinGet, EWD_WinState, MinMax, ahk_id %EWD_MouseWin%
  6. if EWD_WinState = 0  ; Only if the window isn't maximized
  7.    SetTimer, EWD_WatchMouse, 10 ; Track the mouse as the user drags it.
  8.  
  9. EWD_WatchMouse:
  10. GetKeyState, EWD_LButtonState, MButton, P
  11. if EWD_LButtonState = U  ; Button has been released, so drag is complete.
  12. {
  13.    SetTimer, EWD_WatchMouse, off
  14.    return
  15. }
  16. GetKeyState, EWD_EscapeState, Escape, P
  17. if EWD_EscapeState = D  ; Escape has been pressed, so drag is cancelled.
  18. {
  19.    SetTimer, EWD_WatchMouse, off
  20.    WinMove, ahk_id %EWD_MouseWin%,, %EWD_OriginalPosX%, %EWD_OriginalPosY%
  21.    return
  22. }
  23. ; Otherwise, reposition the window to match the change in mouse coordinates
  24. ; caused by the user having dragged the mouse:
  25. CoordMode, Mouse
  26. MouseGetPos, EWD_MouseX, EWD_MouseY
  27. WinGetPos, EWD_WinX, EWD_WinY,,, ahk_id %EWD_MouseWin%
  28. SetWinDelay, -1   ; Makes the below move faster/smoother.
  29. WinMove, ahk_id %EWD_MouseWin%,, EWD_WinX + EWD_MouseX - EWD_MouseStartX, EWD_WinY + EWD_MouseY - EWD_MouseStartY
  30. EWD_MouseStartX := EWD_MouseX  ; Update for the next timer-call to this subroutine.
  31. EWD_MouseStartY := EWD_MouseY
Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: July 17, 2012, 01:12:06 PM »

Hi, plander, and welcome to DonationCoder.  Here is a modified version of the AHK script that should do what you requested:
I believe what plander is asking for is a program that works both with mbutton and with alt. From what I understand, you are suggesting that he runs both the program you posted and the original AHK version, right?
Logged

AndyM
Charter Member
***
Posts: 615


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #3 on: July 17, 2012, 01:35:00 PM »

Move Inactive Window by Skrommel

http://www.donationcoder....Skrommel/#MoveInactiveWin

Hold down the Alt key and LeftClick drag any non-focused window without giving that window focus.  That's the original purpose of the script, but Alt-drag works on the active window also.

You could check out the code to change or add other hotkey combinations.
Logged
plander
Participant
*
Posts: 8


View Profile Give some DonationCredits to this forum member
« Reply #4 on: July 17, 2012, 02:14:15 PM »

i want hold only middle button and drag, not alt + left mouse button, not alt + middle mouse button, only middle
Logged
plander
Participant
*
Posts: 8


View Profile Give some DonationCredits to this forum member
« Reply #5 on: July 17, 2012, 02:18:23 PM »

skwire thank u for the script, it's work, thank you, but it not work for full opened windows and this script can't do many good things that can do altdrag program, may be u can add this feature to the program? Sad
« Last Edit: July 17, 2012, 02:44:46 PM by plander » Logged
AndyM
Charter Member
***
Posts: 615


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #6 on: July 17, 2012, 02:20:15 PM »

then try skwire's script
Logged
plander
Participant
*
Posts: 8


View Profile Give some DonationCredits to this forum member
« Reply #7 on: July 17, 2012, 02:26:43 PM »

and what about edit altdrag program? coz program very useful and functional and i want very much use it with middle button
« Last Edit: July 17, 2012, 02:38:16 PM by plander » Logged
tomos
Charter Member
***
Posts: 8,353



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: July 17, 2012, 04:10:21 PM »

and what about edit altdrag program?

have you asked the author of AltDrag?
Logged

Tom
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: July 17, 2012, 05:28:42 PM »

have you asked the author of AltDrag?
I talk with author, but he say that he haven't time to add this feature and say that i can add by myself, it's free source code, but i don't know coding, but want this feature very much
yep tongue
Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: July 17, 2012, 05:47:31 PM »

AltDrag has a window resize similar to linux: when you press Alt and drag close to the corner, you can resize that window in that direction.
I'm pretty sure I've seen something like that somewhere. Probably it's one of these two (most likely the first one):
http://www.autohotkey.com.../EasyWindowDrag_(KDE).htm
http://www.enovatic.org/p.../niftywindows/onlinedemo/
Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #11 on: July 17, 2012, 05:49:18 PM »

Also, another option: plander, why don't you run the script skrommel posted and altdrag? They complement each other and could solve your problem.
Logged

plander
Participant
*
Posts: 8


View Profile Give some DonationCredits to this forum member
« Reply #12 on: July 18, 2012, 12:39:08 AM »

jgpaiva i run script and altdrag, but they do not interact together , coz when i drag windows by middle mouse button the don't resize and nothing happend (they just moving by script), (when i use alt drag commands) windows resize only when i press alt + drag window, but i want only press middle button and drag and resize. They work separately, not together, this is a problem.

and thank you for the NiftyWindows program, very interesting, but steel haven't drag by middle button and hotkeys in opera not work when run NiftyWindows Sad
« Last Edit: July 18, 2012, 03:00:46 AM by plander » Logged
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #13 on: July 18, 2012, 10:25:03 AM »

I see.
I modified the easywindowdrag script to include the resizing stuff.
See below:
[copy or print]
; This script was inspired by and built on many like it
; in the forum. Thanks go out to ck, thinkstorm, Chris,
; and aurelian for a job well done. Modified by jgpaiva

; Change history:
; November 07, 2006: Optimized resizing code in !RButton, courtesy of bluedawn.
; February 05, 2006: Fixed double-alt (the ~Alt hotkey) to work with latest versions of AHK.
; February 05, 2006: removed alt stuff, changed for middlebutton

; The shortcuts:
;  Alt + Left Button  : Drag to move a window.
;  Alt + Right Button : Drag to resize a window.
;  Double-Alt + Left Button   : Minimize a window.
;  Double-Alt + Right Button  : Maximize/Restore a window.
;  Double-Alt + Middle Button : Close a window.
;
; You can optionally release Alt after the first
; click rather than holding it down the whole time.

If (A_AhkVersion < "1.0.39.00")
{
    MsgBox,20,,This script may not work properly with your version of AutoHotkey. Continue?
    IfMsgBox,No
    ExitApp
}


; This is the setting that runs smoothest on my
; system. Depending on your video card and cpu
; power, you may want to raise or lower this value.
SetWinDelay,2

CoordMode,Mouse
return

MButton::
; Get the initial mouse position and window id, and
; abort if the window is maximized.
MouseGetPos,KDE_X1,KDE_Y1,KDE_id
WinGet,KDE_Win,MinMax,ahk_id %KDE_id%
If KDE_Win
    return
; Get the initial window position and size.
WinGetPos,KDE_WinX1,KDE_WinY1,KDE_WinW,KDE_WinH,ahk_id %KDE_id%
; Define the window region the mouse is currently in.
if (KDE_X1 < KDE_WinX1 + KDE_WinW / 2)
   KDE_WinLeft := 1        
else
   KDE_WinLeft := -1

if (KDE_Y1 < KDE_WinY1 + KDE_WinH / 2)
   KDE_WinUp := 1      
else
   KDE_WinUp := -1

centerX := KDE_X1 > KDE_WinX1 + KDE_WinW / 3 AND KDE_X1 < KDE_WinX1 + 2*KDE_WinW /3

centerY := KDE_Y1 > KDE_WinY1 + KDE_WinH / 3 AND KDE_Y1 < KDE_WinY1 + 2*KDE_WinH /3


Loop
{
    GetKeyState,KDE_Button,MButton,P ; Break if button has been released.
    If KDE_Button = U
        break
    MouseGetPos,KDE_X2,KDE_Y2 ; Get the current mouse position.
    ; Get the current window position and size.
    WinGetPos,KDE_WinX1,KDE_WinY1,KDE_WinW,KDE_WinH,ahk_id %KDE_id%
    KDE_X2 -= KDE_X1 ; Obtain an offset from the initial mouse position.
    KDE_Y2 -= KDE_Y1
    ; Then, act according to the defined region.
    if (centerX AND centerY)
      WinMove,ahk_id %KDE_id%,, KDE_WinX1 + KDE_X2  ; X of resized window
                              , KDE_WinY1 + KDE_Y2  ; Y of resized window
                              , KDE_WinW ; W of resized window
                              , KDE_WinH ; H of resized window
    else
        WinMove,ahk_id %KDE_id%,, KDE_WinX1 + (KDE_WinLeft+1)/2*KDE_X2  ; X of resized window
                                , KDE_WinY1 +   (KDE_WinUp+1)/2*KDE_Y2  ; Y of resized window
                                , KDE_WinW  -     KDE_WinLeft  *KDE_X2  ; W of resized window
                                , KDE_WinH  -       KDE_WinUp  *KDE_Y2  ; H of resized window

    KDE_X1 := (KDE_X2 + KDE_X1) ; Reset the initial position for the next iteration.
    KDE_Y1 := (KDE_Y2 + KDE_Y1)
}
return
DISCLAIMER: I do *not* have a computer to test this code on, so it may very well not work. If any bananas explode when using this program, I claim no responsibility tongue
« Last Edit: July 19, 2012, 10:58:45 AM by jgpaiva; Reason: updating code » Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: July 19, 2012, 10:58:26 AM »

Ok, I've updated the above post to include code that actually has been tested and works! tongue
Logged

plander
Participant
*
Posts: 8


View Profile Give some DonationCredits to this forum member
« Reply #15 on: July 19, 2012, 01:07:03 PM »

jgpaiva yea it's work, but not so cool like altdrag or other functional programs  Sad
Logged
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #16 on: July 19, 2012, 01:09:33 PM »

jgpaiva yea it's work, but not so cool like altdrag or other functional programs  Sad
What are you missing?
Logged

plander
Participant
*
Posts: 8


View Profile Give some DonationCredits to this forum member
« Reply #17 on: July 24, 2012, 03:36:50 PM »

Is it so hard to add middle button feature to altdrag ?
Logged
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: July 24, 2012, 06:46:04 PM »

Given that altdrag is written in C, yes. It would be a considerable amount of work to understand how the program is implemented, and then I'd have to learn how to create the hooks for the middle button in C (which I have zero previous experience). I'm sorry, but if that's what you need, I really can't help anymore Sad
Logged

plander
Participant
*
Posts: 8


View Profile Give some DonationCredits to this forum member
« Reply #19 on: July 25, 2012, 01:05:03 AM »

 Sad and noone else can't do that?
Logged
AndyM
Charter Member
***
Posts: 615


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #20 on: July 25, 2012, 09:34:45 AM »

I've assigned things to the middle button using AutoHotkey.  It can be a little flakey so I only kept the things that worked.

Might be worth a try so you could keep AltDrag and assign either Alt-Left or Alt-Middle to MiddleButtonDown.  Can't see how you could assign both to MiddleButtonDown, and Alt-Middle might be flakey.  Assigning  Alt-Left ButtonDown to MiddleButtonDown would be worth a try if that's the key combo you want to fire when you MiddleClickDrag.
Logged
skwire
Moderator
*****
Posts: 4,021



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #21 on: July 30, 2012, 03:13:08 PM »

Here's an alternative to AltDrag that allows you to set the middle mouse button to resize windows:

http://www.deskex.com/AltMove/index.asp
Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.07s | Server load: 0.09 ]