taming the cursor

Discussion in 'C Programming' started by joe.user0@lycos.com, Aug 21, 2005.

  1. Guest

    Hello,


    I have a text application in C that works well on
    quick machines. On old PCs, I have to press and
    release the arrow keys slowly. If I push and keep
    an arrow key down, the cursor goes wild and lands
    somewhere without any understandable pattern.

    I need an idea - or some code - for the following:

    after executing a command, discard the same
    command if it comes within x milliseconds.


    Thanks.


    Joe
    , Aug 21, 2005
    #1
    1. Advertising

  2. wrote:
    > I have a text application in C that works well on
    > quick machines. On old PCs, I have to press and
    > release the arrow keys slowly. If I push and keep
    > an arrow key down, the cursor goes wild and lands
    > somewhere without any understandable pattern.


    This is platform specific and thus off-topic.

    > I need an idea - or some code - for the following:
    >
    > after executing a command, discard the same
    > command if it comes within x milliseconds.


    Well, on some systems you can detect the events key-press and
    key-release independently. Triggering on release would be a
    simple workaround.

    Anyway, the only way to measure time with a resolution below
    one second is clock().
    Alexander Bartolich, Aug 21, 2005
    #2
    1. Advertising

  3. Alexander Bartolich <> writes:
    [...]
    > Anyway, the only way to measure time with a resolution below
    > one second is clock().


    Um, not really. clock() measures CPU time, not real time. The
    resolution of the time() function is commonly 1 second, but the
    standard doesn't guarantee this.

    Practically speaking, the only way to measure time with a resolution
    below one second is to use some system-specific extension.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
    Keith Thompson, Aug 21, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VG9tYXMgS2VwaWM=?=

    Changing DEFAULT cursor to WAIT cursor in ASP

    =?Utf-8?B?VG9tYXMgS2VwaWM=?=, Apr 5, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,293
    Bruce Barker
    Apr 5, 2005
  2. Sean
    Replies:
    2
    Views:
    430
    Toby A Inkster
    Aug 7, 2003
  3. invy
    Replies:
    4
    Views:
    380
    CBFalconer
    Dec 28, 2006
  4. dmaziuk
    Replies:
    3
    Views:
    554
    Chris Gonnerman
    Jan 25, 2011
  5. Ben Giddings

    Taming Test::Unit

    Ben Giddings, Jun 4, 2004, in forum: Ruby
    Replies:
    3
    Views:
    114
    Bret Pettichord
    Jun 10, 2004
Loading...

Share This Page