mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-09 15:49:20 +00:00
Hooked the input to the torrent loader.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@274 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+26
-16
@@ -9,13 +9,19 @@ namespace input {
|
||||
|
||||
bool
|
||||
TextInput::pressed(int key) {
|
||||
// std::stringstream str;
|
||||
|
||||
if (m_alt) {
|
||||
m_alt = false;
|
||||
|
||||
switch (key) {
|
||||
case 'p':
|
||||
Base::insert(m_pos, "M^p");
|
||||
break;
|
||||
// case 'b':
|
||||
// Base::insert(m_pos, "M^b");
|
||||
// break;
|
||||
|
||||
// case 'f':
|
||||
// Base::insert(m_pos, "M^f");
|
||||
// break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
@@ -52,8 +58,25 @@ TextInput::pressed(int key) {
|
||||
|
||||
break;
|
||||
|
||||
case 0x1B:
|
||||
m_alt = true;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
|
||||
// Testcode.
|
||||
// if (key == KEY_ENTER || key == '\n')
|
||||
// return false;
|
||||
|
||||
// str << "\\x" << std::hex << key;
|
||||
|
||||
// Base::insert(m_pos, str.str());
|
||||
|
||||
// m_pos += str.str().length();
|
||||
|
||||
// return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,19 +84,6 @@ TextInput::pressed(int key) {
|
||||
|
||||
return true;
|
||||
|
||||
// Testcode.
|
||||
// if (key == KEY_ENTER || key == '\n')
|
||||
// return false;
|
||||
|
||||
// std::stringstream str;
|
||||
|
||||
// str << "\\x" << std::hex << key;
|
||||
|
||||
// Base::insert(m_pos, str.str());
|
||||
|
||||
// m_pos += str.str().length();
|
||||
|
||||
// return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,13 +17,15 @@ public:
|
||||
|
||||
TextInput() : m_pos(0), m_alt(false) {}
|
||||
|
||||
size_type get_pos() { return m_pos; }
|
||||
size_type get_pos() { return m_pos; }
|
||||
|
||||
bool pressed(int key);
|
||||
|
||||
void clear() { m_pos = 0; m_alt = false; Base::clear(); }
|
||||
void clear() { m_pos = 0; m_alt = false; Base::clear(); }
|
||||
|
||||
void slot_dirty(SlotDirty s) { m_slotDirty = s; }
|
||||
void slot_dirty(SlotDirty s) { m_slotDirty = s; }
|
||||
|
||||
const std::string& str() { return *this; }
|
||||
|
||||
private:
|
||||
size_type m_pos;
|
||||
|
||||
Reference in New Issue
Block a user