topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Saturday December 7, 2024, 2:54 pm
  • Proudly celebrating 15+ 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: IDEA: fling a window across the screen  (Read 4482 times)

relipse

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 112
  • I love Jesus. Coding in PHP primarily.
    • View Profile
    • See my GitHub
    • Read more about this member.
    • Donate to Member
IDEA: fling a window across the screen
« on: April 13, 2014, 05:54 AM »
You are given these via parameters on execution:
1. sx - Start X point
2. sy - Start Y point
3. fx - Final X point
4. fy - Final Y point
5. d - final displacement (int) of start to finish swipe
6. v - Velocity (double) of how fast the touch or swipe was
7. a - final acceleration of how fast the touch or swipe was accelerating (can be negative)


Coding Snack Job - Accept the above as command line parameters and then
Fling the window across the screen slowing it down due to the friction of the desktop.


This will be in used in conjunction with a touch-pad gesture program which I will release later.
It may pass parameters like so: s100,1032 f1300,123  d103 v1.38882 a-1.313

By the way, use WindowFromPoint() api call from sx,sy to grab the window that needs to be flung
Ex C++Builder coder, current PHP coder, and noob Qt Coder
« Last Edit: April 13, 2014, 06:33 AM by relipse »


relipse

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 112
  • I love Jesus. Coding in PHP primarily.
    • View Profile
    • See my GitHub
    • Read more about this member.
    • Donate to Member
Re: IDEA: fling a window across the screen
« Reply #2 on: April 15, 2014, 12:11 AM »
Ok, so I have been experimenting with the script you posted sk.
Here is my modified version that seems good for my purposes:

https://gist.github.com/relipse/10655325

But my question is, how can I modify it to accept parameters in the command line?
Also where can I input the direction and and grab the current window that the mouse is over or something.
Thanks,
Jim
Ex C++Builder coder, current PHP coder, and noob Qt Coder