#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    86
    Rep Power
    0

    How to scroll up/down the data


    i have a problem in how to used the arrow up/down to view the data on screen please help me ... :chomp: thanks

    int main ( void )
    {
    int ch, ctr;
    clrscr();

    while ( ( ch = get_code() ) != KEY_ESC ) {
    switch ( ch ) {
    case ARROW_UP:
    printf ( "UP\n" );
    // what i input here
    break;
    case ARROW_DOWN:
    printf ( "DOWN\n" );
    break;
    case ARROW_LEFT:
    printf ( "LEFT\n" );
    break;
    case ARROW_RIGHT:
    printf ( "RIGHT\n" );
    break;
    }
    }
    :chomp: :chomp:
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,417
    Rep Power
    1871
    Perhaps it would help if you learnt to use [code][/code] tags when posting code.
    At least to the level of competence which you've figured out for adding smilies.
    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
  4. #3
  5. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,996
    Rep Power
    481
    Are you using conio and cannot recognize the key strokes? What is the issue?
    [code]Code tags[/code] are essential for python code and Makefiles!
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    86
    Rep Power
    0
    Originally Posted by b49P23TIvg
    Are you using conio and cannot recognize the key strokes? What is the issue?
    yes im using conio .. the strokes will be scroll the data data using arrow up and down, left and right for example a long story i want to read it and i want to view the whole story using arow up and down, left and right key on keyboard ...
    :brrr: :brrr: :brrr:
  8. #5
  9. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    Show us the code for get_code().
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    86
    Rep Power
    0
    Originally Posted by Scorpions4ever
    Show us the code for get_code().
    enum{ KEY_ESC = 27, ARROW_UP = 256 + 72, ARROW_DOWN = 256 + 80, ARROW_LEFT = 256 + 75, ARROW_RIGHT = 256 + 77 };

    static int get_code ( void ){ //Get the ascii control input
    int ch = getch();
    if ( ch == 0 || ch == 224 )
    ch = 256 + getch();
    return ch;
    }

    this is the code that handle the keys
    :brrr: :brrr:
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    1
    Rep Power
    0

    How to scroll up/down the data


    There's a 'copy mode' in screen, activated by pressing, ctrl-A, then [ quickly. This gives you a cursor that you can use to scroll backwards.


    Regards,
    Sabareesh
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    86
    Rep Power
    0

    Post


    Originally Posted by sabareesh
    There's a 'copy mode' in screen, activated by pressing, ctrl-A, then [ quickly. This gives you a cursor that you can use to scroll backwards.


    Regards,
    Sabareesh
    there is any posible thing i can do its not working sir ..

IMN logo majestic logo threadwatch logo seochat tools logo