Thread: spontaneous writing

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    2

    spontaneous writing

    Hi,

    how does a computer recognise spontaneously, when a person writes on a pen tablet/PC tablet.
    Does it have to do with multi-threading concept?? ie....if a person writes a word "HAPPY", the moment he writes the character "H" and when he moves to write "A" on the pen/pc tablet,the display would have shown the character "H" or sometimes the entire word...

    can anyone tell me the concept behind it??

  2. #2
    eh ya hoser, got a beer? stumon's Avatar
    Join Date
    Feb 2003
    Posts
    323
    They are called Events. When you hit a key, or press on the screen, or use a pen on a tablet. The OS triggers an event. Just google event handling and the language you want to use to get more information. Mouse moves, key presses, Mouse clicks (or screen taps) are all events that can be caught and used in some fashion.
    The keyboard is the standard device used to cause computer errors!

  3. #3
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    Quote Originally Posted by stumon View Post
    They are called Events. When you hit a key, or press on the screen, or use a pen on a tablet. The OS triggers an event. Just google event handling and the language you want to use to get more information. Mouse moves, key presses, Mouse clicks (or screen taps) are all events that can be caught and used in some fashion.
    To further spell it out, and this is highly depended on your OS/Application framework, the trick is to watch for not just a single event but a sequence of them. In your case it (the logic) might look like:
    Code:
    onPenDown:
        StartingNewLine = true;
        startPosition = currentPenPosition();
    onPenUp:
        // ending line draw
        if ( checkForPreviousLineIntersection(currentPenPosition(), startPosition)
        {
              partOfPreviousChar = true;
        }
        else
        {
              // is part of a new character:
              runOCROnLastLineSet();
        }
    I mean there is a LOT more to it than this, this is not something for the beginner but this should give you a kind of idea on how the flow might work...
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  4. #4
    Registered User
    Join Date
    Feb 2010
    Posts
    2

    Unhappy

    First of all thanx 4 spending time to reply my post..

    I have another doubt, I tried to execute a very simple c pgm, which had no errors when executed in windows. But when i tried to execute in linux platform,there was an segementation fault....

    can u plzzz help me

  5. #5
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Leejoe, it's best if you start a new thread with this question, so it doesn't get buried in another questions discussion.

    Don't be shy, and please post the program you're referring to (or the relevant portion of it). We can't comment very much on code we haven't seen.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > which had no errors when executed in windows. But when i tried to execute in linux platform,there was an segementation fault
    That is all too common (for newbies).
    The fact that it runs on windows just makes you lucky (if you view it that your program ran), or unlucky (if you view it that your program ran despite the errors).

    Post your code, and we'll be able to tell you how to make it correct for both systems.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems installing Mingw5.1.4
    By BlackOps in forum C Programming
    Replies: 2
    Last Post: 07-26-2009, 03:28 AM
  2. Replies: 2
    Last Post: 05-20-2008, 08:57 AM
  3. Very slow file writing of 'fwrite' function in C
    By scho in forum C Programming
    Replies: 6
    Last Post: 08-03-2006, 02:16 PM
  4. Folding@Home Cboard team?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 398
    Last Post: 10-11-2005, 08:44 AM
  5. help! fifo read problem
    By judoman in forum C Programming
    Replies: 1
    Last Post: 08-16-2004, 09:19 AM