def getEntry(window, key):
    """ Enter an entry, using the window to display the entry
        It handles key (a string) as the start of the entry
        Returns a tuple: (string entered, key pressed to abort entry) """
    window.refresh()
    y, x = window.getmaxyx()
    if key[0] == '_':
        key = '-' + key[1:]
    window.addstr(0, 0, key)
    window.refresh()
    engineeringkey = 'e'
    decimalpoint = '.'
    if key == '.':
        decimalpoint = ''
    c = window.getkey()
    while c in '1234567890' + engineeringkey + decimalpoint:
        if engineeringkey == '-':
            engineeringkey = ''
        if c == 'e':
            engineeringkey = '-'
            decimalpoint = ''
        if c == '.':
            decimalpoint = ''
        key = key + c
        displaykey = key[:x - 1]
        if len(key) != len(displaykey):
            displaykey = displaykey[:-3] + '...'
        window.clear()
        window.addstr(0, 0, displaykey)
        window.refresh()
        c = window.getkey()
    window.clear()
    window.refresh()
    return key, c
