diff --git a/src/core/cli.py b/src/core/cli.py index 2b9f8173..0b46167d 100644 --- a/src/core/cli.py +++ b/src/core/cli.py @@ -37,6 +37,8 @@ def open(): # Set these values in settings class for use elsewhere settings.set("stdscr", stdscr) settings.set("maxxy", maxxy) + settings.set("clinex", 0) + settings.set("cliney", 0) # Start loop in new thread thread = bt.needle.Needle(cline.loop.loop) diff --git a/src/core/cline/__init__.py b/src/core/cline/__init__.py index 63228c41..008ac991 100644 --- a/src/core/cline/__init__.py +++ b/src/core/cline/__init__.py @@ -2,4 +2,4 @@ __author__="bjschuma" __date__ ="$Dec 19, 2009 9:13:05 PM$" -__all__ = ["loop"] \ No newline at end of file +__all__ = ["addch", "loop"] \ No newline at end of file diff --git a/src/core/cline/addch.py b/src/core/cline/addch.py new file mode 100644 index 00000000..0c09eceb --- /dev/null +++ b/src/core/cline/addch.py @@ -0,0 +1,21 @@ +#! /usr/bin/python + +# To change this template, choose Tools | Templates +# and open the template in the editor. + +__author__="bjschuma" +__date__ ="$Dec 19, 2009 11:19:43 PM$" + + +import curses +import settings + + +def addch(input): + stdscr = settings.get("stdscr") + c = stdscr.getch() + + if(c >= 32 and c<= 126): + input += curses.keyname(c) + + return input \ No newline at end of file diff --git a/src/core/cline/loop.py b/src/core/cline/loop.py index 485a3b28..eee3ae35 100644 --- a/src/core/cline/loop.py +++ b/src/core/cline/loop.py @@ -6,11 +6,12 @@ __author__="bjschuma" __date__ ="$Dec 19, 2009 9:39:37 PM$" -import curses from bt.message import write import manager -import settings + +# Command line related imports +from addch import addch global halt @@ -20,14 +21,12 @@ def loop(): write("Beginning command line loop",True) global halt - stdscr = settings.get("stdscr") + #stdscr = settings.get("stdscr") input = "" while halt == False: - c = stdscr.getch() + input = addch(input) - if(c >= 32 and c<= 126): - input += curses.keyname(c) #input=input[:x-4]+curses.keyname(c)+input[x-4:] #self.changeLine(y) #self.stdscr.move(y,x+1)