Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7612911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:02:15+00:00 2026-05-31T02:02:15+00:00

r = 0 mypad.addstr(0, 0, Test…) while 1: mypad.refresh(r, 0, 1, 1, 10, 10)

  • 0
r = 0
mypad.addstr(0, 0, "Test...")

while 1:
    mypad.refresh(r, 0, 1, 1, 10, 10)
    c = mypad.getch()

    if c == curses.KEY_UP:
        r -= 1
    elif c == curses.KEY_DOWN:
        r += 1
    elif c == ord('q'): break 

Test... is displayed, but when I press up/down it just disappear.

Update:

actually when adding more lines I found it scrolls, but only upwards, not below initial position. No matter how big r will be, the text will stay on first row. What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:02:16+00:00Added an answer on May 31, 2026 at 2:02 am

    Check what values do you get for up/down arrows and compare them with curses.KEY_UP/DOWN. See My cursor keys do not work.

    For example, key-up returns as 3 characters on my terminal:

    import curses
    
    with curses_screen() as stdscr:
        pad = curses.newpad(100, 100)
        pad.addstr(0,0, curses.longname())
        for i in range(1, 10):
            pad.addstr(i,0, str(i))
    
        coord = 5, 5, 20, 75
        pad.refresh(0, 0, *coord)
    
        KEY_UP, KEY_DOWN = 'AB'
        y = 0
        for c in iter(pad.getkey, 'q'):
            if c in '\x1b\x5b': continue # skip escape seq
            y -= (c == KEY_UP)
            y += (c == KEY_DOWN)
            y = min(max(y, 0), 9)
            pad.refresh(y, 0, *coord)
    

    Definition of curses_screen().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Question i am asking might be a basic but i really need more
I am using implode to create a query string but there is an unexpected
I have a project for the iPhone, and I'm using an iPad to test
I am aware that force killing an app is very bad, but the client
Ordinarily, exiting my application by calling: android.os.Process.killProcess(android.os.Process.myPid()); performs well without incident. But every once
I'm trying to implement a templated configuration file. I'd prefer python, but I'd take
I'm trying to sign a XML file using pyxmlsec/xmlsec/libxml2 but it fails ( sigCtx->signValueNode
The app works fine when called afresh and used, but it doesn't behave well
Hallo, there are a lot of stuff with bitmap size exceeds VM budget.but where
i am using he quartz for drawing the image in my view and now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.