Mouse pinch



  • I'm trying to write a routine that will allow me to create a certain effect on an LCD monitor.
    You know when you touch the screen, i gives you this distortion depending on how hard you press against it?
    I was thinking there was perhaps an API function that would allow me to throw the mouse pointer against the LCD at a certain velocity to create this effect from the inside? Good values would be 0..50 non destructive 51..100 will basically destroy your monitor.

    Anyone?

    Thanks,

    FERD



  • Not one function but I think I can help you out.  Use Apache's RealLife java library (org.apache.rl) and then use the following code.

    NOTE:  I didn't test this as I don't want to break my monitor.

     

    Person user = Person.getCurrentUser();

    Hand hand = user.getHand(true);  // gets a hand, true means we want the dominant hand.

    assert(hand != null); // doesn't work for paraplegics. 

    PhysicalObject mouse =  Computer.getPeripheral(PeripheralType.PointingInputDevice);

     hand.pickup(mouse);

    assert(!hand.isEmpty()); // if there is no mouse, or for some reason the mouse is too far away, just give up.

    PhysicalObject monitor = Computer.getPeripheral(PeripheralType.DisplayOutputDevice);

    hand.projectContents(monitor.getCenterOfGravity(),  //the first param is the point at which to project the mouse.  Since the monitor is so close, we will ignore gravity and the projectile arc

        <insert speed here>,    // second param is a double from 0 to 1 which is the strength to through the projectile.  NOTE:  higher values decreases accuracy.

        ThrowingStyle.OverHand);  // don't throw like a bitch

        

      



  • The Funny Stuff forum is over there.



  • @Spectre said:

    The Funny Stuff forum is over there.
    This might be a serious question.


  • Discourse touched me in a no-no place

    @tster said:

    assert(hand != null); // doesn't work for paraplegics. 

    [...]

    assert(!hand.isEmpty()); // if there is no mouse, or for some reason the mouse is too far away, just give up.

    Isn't this an incorrect use of assert()s? Shouldn't they just be regular if() tests?


  • @SuperFerd said:

    I was thinking there was perhaps an API function that would allow me to throw the mouse pointer against the LCD at a certain velocity to create this effect from the inside?
    Take this to Stack Overflow if you want to get a serious answer to such a difficult question. I'm sure they can help you.



  • @PJH said:

    @tster said:

    assert(hand != null); // doesn't work for paraplegics. 

    [...]

    assert(!hand.isEmpty()); // if there is no mouse, or for some reason the mouse is too far away, just give up.

    Isn't this an incorrect use of assert()s? Shouldn't they just be regular if() tests?
     

    Meh, this code isn't going into production.  Hell, it can only be ran a single time.  But yes, asserts should only be used when you think a statement can not be true.



  • Yeah. I also had problems with your assertions.
    I also had to rewrite your comments, because they didn't make any sense. Then I had to rewrite your code, to match my comments.
    Now my webcam is shooting flames.

    Thanks anyway.



  •  Hi,

     Did you manage to resolve this problem (Shooting flames out of a webcam)?

    Can you plz share me teh codes? Need know how to make webcam shoot flames for my latest project. URGENT!

     



  • Well Sir, unfortunately there will be a delay in the release of this amazingly awesome (and dangerous => if not THE most dangerous) piece of code.
    You see, to shield off against virtual web terrorists and internet gangster bitches, I encrypted it with this software - http://kryptochef.net/index2e.htm
    (The problem: I gave the key to my homeboy; Let's call him Battle-Monkey Bernard. I don't wonna get into to much detail, but he lost the key during or after sodomizing my neighbors donkey. At least that's what he said. But who can really trust a donkey, right?)

    Anyway, as you can see, it is the best cryptographical achievment since the discovery of the nazi typewriter thingy (or possibly even with speaking in tongues).
    The software uses 256 full-bit compression.
    I quote:
    "
    KRYPTO multiple uses a 256 bit (fullbit) encryption on the inside information of
    the key data.
    This is the absolutely highest technically encryption key length and depth of the
    computers is possible.
    It will be a self-developed by me (ONLY) in KRYPTO used (OTP encryption method) is used.
    KRYPTO can neither humans or computers, without the right key or password unauthorized
    to decrypt.
    "

    Please help me get my codes back.

    Thanks, FERD


  • :belt_onion:

    @SuperFerd said:

    Well Sir, unfortunately there will be a delay in the release of this amazingly awesome (and dangerous => if not THE most dangerous) piece of code. You see, to shield off against virtual web terrorists and internet gangster bitches, I encrypted it with this software - http://kryptochef.net/index2e.htm (The problem: I gave the key to my homeboy; Let's call him Battle-Monkey Bernard. I don't wonna get into to much detail, but he lost the key during or after sodomizing my neighbors donkey. At least that's what he said. But who can really trust a donkey, right?)

    Anyway, as you can see, it is the best cryptographical achievment since the discovery of the nazi typewriter thingy (or possibly even with speaking in tongues).
    The software uses 256 full-bit compression.
    I quote:
    "
    KRYPTO multiple uses a 256 bit (fullbit) encryption on the inside information of
    the key data.
    This is the absolutely highest technically encryption key length and depth of the
    computers is possible.
    It will be a self-developed by me (ONLY) in KRYPTO used (OTP encryption method) is used.
    KRYPTO can neither humans or computers, without the right key or password unauthorized
    to decrypt.
    "

    Please help me get my codes back.

    Thanks, FERD

    I think you'll find your codes in the same place as where you left your <br> <p> and </p> tags


Log in to reply