mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 19:22:29 +00:00
Hide/show input and status bar depending on whetever input has focus.
Added removal of downloads. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@283 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+10
-9
@@ -1,15 +1,15 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <ncurses.h>
|
||||
|
||||
#include "text_input.h"
|
||||
#include <sstream>
|
||||
|
||||
namespace input {
|
||||
|
||||
bool
|
||||
TextInput::pressed(int key) {
|
||||
std::stringstream str;
|
||||
//std::stringstream str;
|
||||
|
||||
if (m_alt) {
|
||||
m_alt = false;
|
||||
@@ -32,6 +32,7 @@ TextInput::pressed(int key) {
|
||||
|
||||
} else {
|
||||
switch (key) {
|
||||
case 0x08:
|
||||
case KEY_BACKSPACE:
|
||||
if (m_pos != 0)
|
||||
Base::erase(--m_pos, 1);
|
||||
@@ -64,19 +65,19 @@ TextInput::pressed(int key) {
|
||||
break;
|
||||
|
||||
default:
|
||||
//return false;
|
||||
return false;
|
||||
|
||||
// Testcode.
|
||||
if (key == KEY_ENTER || key == '\n')
|
||||
return false;
|
||||
// if (key == KEY_ENTER || key == '\n')
|
||||
// return false;
|
||||
|
||||
str << "\\x" << std::hex << key;
|
||||
// str << "\\x" << std::hex << key;
|
||||
|
||||
Base::insert(m_pos, str.str());
|
||||
// Base::insert(m_pos, str.str());
|
||||
|
||||
m_pos += str.str().length();
|
||||
// m_pos += str.str().length();
|
||||
|
||||
return true;
|
||||
// return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user