473,782 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

curses event handling


I have a curses app that is displaying real time data. I would like
to bind certain keys to certain functions, but do not want to block
waiting for

c = screen.getch()

Is it possible to register callbacks with curses, something like

screen.register ('keypress', myfunc)

Thanks,
JDH
Jun 7 '06 #1
0 1058

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1207
by: Pierluigi Fabbris | last post by:
I'm a python programmer since three month and I need that you help me. I want to use python in my web site and in particular I want to add to a ref in Html <a href=""> a event. The event is the getmouse of curses. In this way I want to admin the click of the ref to start the function startfile() to open every files (*.pdf, *.word) with the current application. In my editor Python 2.2 that I download in www.python.it I've not the curses....
0
1141
by: Magnus Lie Hetland | last post by:
I'm playing around with curses, and have had some problems with that... For example, I can't make colours work in Python, although several other curses-based programs use colours on my box. (ncurses, I suppose -- and some maybe slang?) Does Python use ncurses now -- or? But the colours aren't that important. More important is my inability to get latin 1 characters to work in Textpad objects. (I can't get the page up/down and backspace...
0
1775
by: Matthew Alton | last post by:
The appended program freaks python 2.2 & 2.3 completely out. To reproduce the wierdness: i) copy the source to a file called consarn.py ii) $ python consarn.py; iii) the program is now doing a getch(); iv) hit a key; v) the program locks up, the interptreter is now munching on the CPU; vi) kill the interpreter from another shell; vii) scratch head and wonder why neither of the mutually exclusive clauses in the _io() member function...
0
1877
by: Matt Garman | last post by:
I'd like to write a class or module in python that allows me to do on-the-fly color changing in the curses module. I'm thinking about something along the lines of this: addstr(y, x, 'hello', brightyellow, blue) The module would automatically interpret the above as curses.init_pair(i, curses.COLOR_YELLOW, curses.COLOR_BLUE)
4
6021
by: Peter | last post by:
Last November I posted a message asking for advice on using simple screen handling techniques under Windows. Since then I have been occupied with family / job /Christmas /living and trying to understand curses under linux (it works, seems very complex, sure I'm missing something ...). Only now am I returning to my original query. One reply (in fact the only reply - thanks Tim Golden) suggested I look at...
1
3697
by: Jerry Fleming | last post by:
Hi, I have wrote a game with python curses. The problem is that I want to confirm before quitting, while my implementation doesn't seem to work. Anyone can help me? #!/usr/bin/python # # Brick & Ball in Python # by Jerry Fleming <jerryfleming@etang.com>
48
4566
by: Daniele C. | last post by:
As soon as my sourceforge.net project gets approved, I am going to build a ncurses port to win32 bindable to sockets, e.g. allowing VT100/ANSI terminals and the creation of simple terminal servers using the ncurses API for the UI. I plan to initially support only a subset of the ncurses lib, leaving the lib open to expansion/completion. Please stop me if I am going to reinvent the wheel, and tell me if there are any libraries of this...
4
2502
by: James Stroud | last post by:
Hello, Is curses really lacking an event loop? Do I have to write my own? I infer from the docs that this is the case. For example, I want the screen to be updated with resize but I find myself waiting for getch() if I want user input, and so the screen must remain ugly until the user presses a key. What am I missing? Also, does anyone have boilerplate for handling mouse events? getmouse() returns an "ERR" of no particular description...
5
6332
by: 7stud | last post by:
I can't see to get any y, x coordinates to work with curses. Here is an example: import curses def my_program(screen): while True: ch = screen.getch() if ch == ord("q"): break
0
9639
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9479
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7492
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6733
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5509
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4043
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.