Opinions about Mouse Movement Speed

Hi !
I'm experimenting with some Java gfx routines and so I want to code a tiny game, for that I need a small routine to get the current mouse movement speed. I tried this:
myFrame.addMouseMotionListener(new MouseMotionListener() {
  public void mouseMoved(MouseEvent me) {
  if ((me.getX()!=320)||(me.getY()!=240)) {
    spdX = me.getX() - 320;
    spdY = me.getY() - 240;
     myRobot.mouseMove(320,240);
});, but I'm not totally satisfied with this.
a) you'll never get a zero movement with this one
b) I don't know if this would work smooth
Does anyone have any suggestions about this or maybe a link to some resources about that?
thx in advance
Skippy

Well, this is the part of the Code I get my Input-information from:
public class
InputLib
  private static      JFrame               mainFrame;
  private static     int                    spdX, spdY;
  private static     Robot               myRobot;
  private static     boolean               invokedByRobot = false;
  public
  InputLib()
    mainFrame =     GfxLib.getMainFrame();
    try { myRobot = new Robot(); } catch (AWTException awtex) {System.out.println("Couldn't create Robot.");}
    myRobot.mouseMove(320,240);
    mainFrame.addMouseMotionListener(new MouseMotionListener() {
      public void mouseDragged(MouseEvent me) {}
      public void mouseMoved(MouseEvent me) {
        if (!invokedByRobot) {
          if ((me.getX()!=320)||(me.getY()!=240)) {
            spdX = me.getX() - 320;
            spdY = me.getY() - 240;
            invokedByRobot = true;
            myRobot.mouseMove(320,240);
            invokedByRobot = false;
          } else {
//          spdX = 0;  this always returns (0,0) ?!?
//          spdY = 0;
  public static int     getSpdX() {
    return spdX;
  public static int     getSpdY() {
    return spdY;
}and this is my gameloop:
Graphics gr;
Graphics gBB;
while (true) {
  gr = GfxLib.getDrawGraphics();
  if (!GfxLib.contentsLost()) {
    try {
      do {
        GfxLib.resetBackbuffer();
        gBB = GfxLib.getBackBuffer().createGraphics();
        int dx = InputLib.getSpdX();
        int dy = InputLib.getSpdY();
        gBB.drawImage(bg, 0, 0, null);
        gBB.drawLine(100,100,100+dx,100+dy);
        obj1.setSpdX(dx);
        obj1.setSpdY(dy);
        obj1.moveStep();
        obj1.translateTexture(dx,-dy);
        gBB.drawImage(obj1.getViewport(),obj1.getPosX(),obj1.getPosY(),null);
        gBB.dispose();
        gr.drawImage(GfxLib.getBackBuffer(), 0, 0, null);
      while (GfxLib.getBackBuffer().contentsLost());
    catch (Exception e)
      Logger.log(e);
    frameTime = GfxLib.getTicksSinceLastShow();
    if (frameTime < MAX_FRAMES)
    try {
      Thread.sleep(MAX_FRAMES-(frameTime));
    } catch(InterruptedException intex){intex.printStackTrace();}
    GfxLib.show();
    gr.dispose();
}The GfxLib calls handle hardware-accelerated, doublebuffered fullscreen graphics, but this also works when drawing to a normal Component. obj is a simple textured shere that I want to draw onto the screen.
Purpose: simply draw a rolling textured ball controlled by the mouse.
Hope this explains a bit,
Skippy

Similar Messages

  • Question about mouse track speed and interpolation.

    To give context it's a regular practise for windows gamers to set their mouse/pointer speed to 6/11 (middle notch, 6th out of the 11) in your system settings.
    The reason being that setting provides a 1:1 ratio, signal from your mouse translating into pointer movement without any interpolation.
    Which brings me to my question: On what setting, in Leopard, do you get that 1:1 ratio / zero interpolation.

    To give context it's a regular practise for windows gamers to set their mouse/pointer speed to 6/11 (middle notch, 6th out of the 11) in your system settings.
    The reason being that setting provides a 1:1 ratio, signal from your mouse translating into pointer movement without any interpolation.
    Which brings me to my question: On what setting, in Leopard, do you get that 1:1 ratio / zero interpolation.

  • Different mouse clicks & speed up mouse movements?

    Hello,
    Does Adobe Captivate recognise different mouse clicks better
    to say if it can record on RMB LMB and MMB clicks different
    effects? For example I wish to record Software Simulation project
    were on different mouse clicks (RMB, LMB, MMB) would have custom
    effects like "OrangeRing" for RMB " "GreenRing" for LMB etc?
    One more question plz: I found Published movie mouse
    movements are very slow can I make it move more fast without
    editing every slide separatelly?
    Thanks
    Ton

    Hello Tony,
    Whilst Captivate does recognize different mouse clicks (in so
    much as the application will capture a right-click menu) you cannot
    specify what type of mouse effect the application will use when you
    capture.
    What you can do is change the mouse click effect post
    capture. To do this and with a just captured project open carry out
    these steps:
    1. Select the slide that has a mouse pointer where you would
    like need to show a right-click action.
    2. Choose Slide > Mouse > Properties...
    3. In the Mouse Properties dialog make sure that the option
    "show mouse click" is selected and then show either the color or
    the custom effect you would like to use to represent the
    right-click operation.
    Naturally, at the very start of your movie/project you would
    need to inform the learner that each time they see the one of the
    effect you want them to right-click. You could also include some
    audio as well which would be important if you need to adhere to
    accessibility standards.
    In regard to your second question, in most cases you will
    find that you get the best result if you adjust the mouse timing
    using the Timeline.
    That said if you own a copy of Adobe Captivate 2 you can
    change the mouse Display and Appear After settings globally via the
    Mouse Properties dialog. Personally, for mouse movement I would not
    recommend this. Anyway here are the steps to carry that out.
    1. Select any slide that has a mouse pointer present.
    2. Choose Slide > Mouse > Properties...
    3. Click the Timing tab
    4. Change the Display time and Appear After values
    5. Click the Settings button
    6. Choose the appropriate options from both Which properties
    and which slide categories
    7. Click OK.
    Note : You can also show the Mouse properties dialog by left
    clicking on mouse icon on any of the slides in the Filmstrip
    Regards,
    Mark

  • VI execution speed depending on mouse movement

    Hi,
    I have a large application that sometimes became very very slow. When It happens the only thing that I was able to notice is that moving mouse, execution speed of vi come back normal. I checked all the opened reference but I didn't find any not closed reference.
    Any tip will be helpfull..
    Golzio

    can you give us any other information or post an example of the program. Does it use an event structure, data acquisition, are you performing file i/o? If you can give us an example it would be most helpful. Thanks
    BJD1613
    Lead Test Tools Development Engineer
    Philips Respironics
    Certified LV Architect / Instructor

  • CS3 Ext. Vista 64 jerky mouse movement

    Hi there,
    I have a huge problem with my 32 Bit Photoshop CS3 Extended under the operating system Windows Vista Business 64 Bit and don't know if this is a known problem or has to do with the 64 Bit or something. I don't know what to do more so I ask here in hope of some help.
    The problem: When I use the f-key to switch to a mode where the image uses the whole space behind the tool paletts and use the space-key to switch temporarily to the move tool to move the image around, my next mouse movements with click actions will be really jerky.
    To explain this further more imagine you are on a deep zoom level inside an image, using the polygon lasso to mark an object exactely, there's often the situation where you come to the border of what you can still see and what you can't see anymore. Here you'd use space and move the window a bit in the direction you want to continue marking the object. When I do that (in fact after the first time i do that) I see that the whole processing of generating those marking points with the lasso gets really jerky as if the pc is studdering. It is not possible to work fluently and/or fast this way. As you can see from my speccs (see further down for details) pc speed is no real issue here. Other things like GPU-heavy games (e.g. Crysis) don't show any studdering.
    Things I already tried to no success:
    1) deactivated version cue
    2) bumped the memory that Photoshop may use from 2.5 GB to the maximum of about 3.5 GB. Windows still has plenty of memory left for itself as Photoshop seems to have a border here that windows itself hasn't.
    3) deactivated GPU-Support temporarily
    Some more information:
    1) Windows and Photoshop are on their newest versions/patches.
    2) There is no emulation software and no Nero installed.
    3) The file I'm testing this with is newly made (ctrl-n) in a resolution of 1280x1024 @ 300 dpi plain white. This shouldn't be extremely large.
    4) Computer speccs: Intel Core i7 920 @ 4000 MHz, 6GB DDR3-1600, Geforce GTX 285 Black Edition, Watercooling for processor and north-/south-bridge and condensators. The whole system resides on 2 500GB Samsung Spinpoint F1's that run in raid 0 mode for speed purposes. Partitioning is done so that the operating system, programs, data, temp-files, photoshop swap file, windows swap file (and some more partitions) are each on separate partitions.
    5) CPU/GPU temperatures are on nice levels (about 50°C each) and at least what I see from the CPU usage all 4 CPU-cores are getting bored during all this (less than 10% usage each).
    6) This is nothing that is limited to the polygon lasso tool: If i use the clone stamp tool or a brush I get the same problem after moving the image around with the move tool on a higher zoom level.
    7) I didn't have this problem on my old pc with Athlon 64 4000+ single core with 2 MB RAM and Windows XP Prof. 32 Bit. Furthermore I haven't seen my new pc without that problem so far. So the problem exists from the beginning.
    Any help is much appreciated! I hope I made myself as clear as possible. If there are questions on your side please ask.
    Kind Regards
    Steve

    Yes, of course the guarantee is solely on the vendor's part. They give 5 years of guarantee on the hardware as they build them together.
    That is an interesting information with CS3 and multi-core-systems. I shall google that and see what information I find about it. Thanks for the remark.
    I'd be more than happy if some folks here could bring some more light in the 64Bit-RAM-size-scratch-disk-issue and how it affects CS3-behavior. Would be really helpful.
    Right now it should be (almost) like this: Vista gets about 2.5GB of RAM, Photoshop gets about 3.5GB of RAM, that is if Photoshop would take it (I'm not sure if it does although I configured it to do so). Being able to use the whole 6GB of RAM was the reason to use a 64Bit OS.
    EDIT: I found a test with dual-core and quad-core systems with Photoshop CS3. The operating system seems to be 32 Bit though. It seems that CS3 doesn't scale very well with 4 cores. It uses 2 apparently but cannot make use of more. But anyway as I said: My old PC with a speed of 2.4GHz (single core Athlon 64 4000+) whose clock-speed is not directely comparable to my i7's 4GHz because of efficiency did the job without studdering. It had only one core that was much (!) slower than any single core on my i7. Even if the multi-core cannot be used from CS3 one would think that it had to run faster with the i7. In my opinion it must have something to do with either the 64 Bit OS or the raid0. The partions were no issue on the old machine (although I used multiple HDDs in the past so Windows and Photoshop were on the same HDD on different partitions but the scratch disks were on another).

  • I just created a new profile/user on my MacBook Pro. My pointer/mouse. It works fine in my older user profile, but when I go to the new profile my mac will not respond to clicks. Mouse moves but will not click. Already tried restarting and the pram zap.

    I just created a new profile/user on my MacBook Pro. My pointer/mouse on my trackpad. It works fine in my older user profile, but when I go to the new profile my mac will not respond to clicks. The Mouse moves but will not click. Already tried restarting and the pram zap. The problem starts when I log out of my main profile. I get to the login screen and my laptop stops responding to clicks. When I manage to make my way back to my main profile the mouse works perfectly.  Should I just delete the new profile and try again?

    If the modem is also a router, either use the modem in bridge and run pppoe client on the TC.. that is assuming ADSL or similar eg vdsl. If it is cable service.. and the modem is a router, then bridge the TC.. go to internet page and select connect by ethernet and below that set connection sharing to bridge.
    Please tell us more about the modem if the above gives you issues.

  • How to detect mouse movement/key press on Mac?

    Need to write a VI that will detect/report mouse movement (ie. returns it's location) and any key (or key combinations) pressed. And, to send the mouse pointer to any location on screen. Using Labview 6i on Mac.

    The event structure is new to LabVIEW 6.1. I could post 6.1 code but I cannot save the structure for previous and LabVIEW will not open a VI from a newer version. The best place to learn about the event structure is on the What's new in LabVIEW 6.1 page.
    http://amp.ni.com/niwc/labview/lv.jsp?node=1381

  • In "edit" mode, my movie speed is fine. Once published it seems to slow down and become all jerky. Any ideas? Thanks

    In "edit" mode, my movie speed is fine. Once published it seems to slow down and become all jerky. Any ideas? Thanks

    I have a revision a imac g5 with the same problem with only macbreak podcast. I know leo laporte said that the podcast was done in 1080p and my computer with its built in 64 megabyte graphics card might have trouble with this podcast but your machine must have a better graphics card than mine. 1080p requires at least 128 megabytes of graphics memory built in. My machine played this podcast on quicktime fine until they came out with the update to quicktime last week or two ago. I was going to upgrade my memory until I came accross your story and your machines doing the same thing with much better specs. I think it might be the quicktime update that is causing a problem. Maybe Leo will talk about this problem since he is doing a mac show about macs.

  • Lion mouse scroll speed scrolling too fast

    System Pref > Mouse > Scrolling Speed is set to the slowest level and it is still way too fast!  Heard others complaining about this on a Parallels discussion group and thought I would post here.  Incease the range of scrolling sensitivity in an update please!  Reply to this post if you are having the same issue.
    Scrolling was always way to fast in leopard when using Iphoto, but this with Lion it is too fast everywhere else except for huge files.

    I suppose you are using a non-Apple mouse. You will need to update the software, and adjust the tracking multiplier within the software.
    Logitech just came out with an update for Lion.

  • Mouse scrolling speed is too fast

    It appears that iPhoto doesn't honor the mouse scrolling speed in system prefs. Scrolling with the mouse is useless for me because the slightest up or down movement scrolls several pictures at a time. I have a Logitech MX Revolution... I don't know if the mighty mouse behaves any differently. Is anyone else annoyed by this?

    Nevermind... I discovered the Logitech prefs allow me to fine tune the scroll wheel.

  • Capturing mouse movement to define an animation path?

    Hi All,
    Does there exist a plugin for flash that would allow me to
    define animations by capturing my mouse movements? I'd like to be
    able to rough in my animation timing by selecting an object, then
    dragging it around the screen at will while the software captures
    the path of motion along with the timing of it. This would allow me
    to keyframe a rough animation sequence really quickly because the
    computer clock and my hand motion defines the placement of the
    various keyframes. Is anything like this possible right now?
    Thanks

    i dont think so.. but why dont you use the pencil tool and
    draw on the stage, make that layer a guide layer, the shorten the
    distances of keyframes for your animation so it looks like it's
    speeding up, widen them to look like its slowing down

  • Why does my mouse move slowly?

    Why does my mouse move slow?

    Check the setting for tracking speed. You'll find that in System Preferences > Mouse.
    Note that tracking speed has variable accelleration associated with it; it responds to the speed of the mouse movement as well as the distance. When the tracking speed is set to fast, a slow movement of the mouse will yield an approximate one-to-one response from the cursor; but if you flick the mouse quickly, the cursor will fly across thre screen.
    If you're using a non-Apple mouse, and it came with its own software, check in that control pane for a similar setting.

  • Mouse Move on the column Chart

    Hi all visitors
    I have created one crystal report and in my report i have created one column chart.
    but i don't show the value on the column chart,however, when i move mouse on that column chart,
    it will show the value.but in crystal report server,when i move the mouse on the column, it doesn't show the value like crystal report.
    Anyone know about this how to show the value on the column when mouse move in crystal report server?
    Please help me for this.
    Best Regards,

    Unfortunate Tool tip doesn't work with CR Charts.
    Probably there may be some  trick that will configure to achieve. But I didn't came across till now.

  • Cf# file, lost help viewer, & mouse tracking speed very fast...

    Yes really ! - I do believe it all happened at once.
    No recent system changes/updates/hacks - OS has latest updates - all worked splendidly...until:
    put the mac to sleep, back 1/2 hr later & changed mouse batteries - woke it up & mouse speed is superfast,help viewer wasn't working & files starting with cf# keep appearing momentarily in ~/library/preferences/ . the format seems to be cf#xxxxx - a different one each time
    maybe the file thing is nothing to do with it? - but would be interested in what it is.
    Help viewer fixed by trashing cache & plists - now fine
    Mouse speed can be slowed to a crawl using sys prefs-mouse & keyboard-tracking speed but just one step up from that; it's superfast again. The speed does increase even more if the slider is moved higher.
    So Question - finally! - is this lot related in any way?
    what's the cf#7zgE1 file about?
    what other files might compromise the mouse tracking speed ( I have no mouse-enhancing software )
    Thankyou

    re: cf#xxxx files, you wrote:"I'd love to, but they appear/disappear in an instant - took 7 attempts with grab to get a shot that included one. Nothing in console, no startup/login items at all."The information macjack provided in the link you cited isn't particularly relevant. All that document describes is the Mac OS X facilities for creating and managing preferences files, part of Core Foundation Framework. It doesn't explain the cf#xxxx files, it merely discusses preferences from a programmer's perspective.
    Since the appearance of these, and their mention on the Discussions, is a relatively new phenomenon, I'd be more inclined to suspect they are the side effect of some third-party application you may have installed recently, e.g. some bit of new shareware, a widget, etc. Such an app may be temporarily writing and removing those files, but the fact that they begin with "cf" may have been a developer's choice. The file names don't even correspond to the standard for preferences files. Just because they're in the Preferences folder does not make them preferences.
    I don't see them on my system. You'll have to monitor apps you launch, running widgets, third-party menu extras, etc. to see if the creation of the files begins after some such process is launched.
    If they show up, as you noted, with just Mail and Safari running (assuming you did not open Dashboard, which results in all widgets being launched), then they could be the result of either an Internet plug-in or a Mail plug-in you might have installed.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • Mighty mouse moves too slow

    Does anyone know how to increase movement speed?
    I've already set Tracking speed to the maximum in Preferences, but it's still not enough.
    Is there any other way to increase movement speed except using third party software like SteerMouse?

    Hello again:
    I do not know of any setting in OS X (besides the one you mention) that will affect the mouse tracking speed.
    Barry

Maybe you are looking for

  • Info prologation request license

    I sent an e-mail to Sap sapport. They wrote me to post a message to SAP Service Marketplece  and the License Department will assist my request. Could you help me, please ? Kind Regards. Sent: 13 June 2008 08:57 To: SAP Support Italy Subject: Info pro

  • Skipping dependent Tables in Logical Standby

    Hello DBAs I need your expertise here. Let me explain the scenario. Suppose a table is skipped in a logical standby. This table is referred by other tables and there are dependencies on this table. Now my question is what happens when a transaction i

  • Creating video for a 9:16 screen (standard display mounted vertically)

    Is it possible to use FCEHD to produce a video that will be shown on a 16:9 screen that is being mounted vertically. I'm assuming I'd want to reverse the pixel numbers....i.e. swap width for height, etc. Can I do this? Is there another approach? (The

  • HT201250 Why won't time machine stop running?

    Why does Time Machine dialog box appear after switching it to the off position?

  • Where have all the playlists gone??

    I went to use my iPod nano, I wanted to select a playlist...but none of them were there! All it said was **[my name]**'s iPod Selection. None of the others were there, not even the ones it does automatically like Top 25 Most Played and My Top Rated.