mirror of
git://projects.qi-hardware.com/vido.git
synced 2024-12-22 13:58:59 +02:00
switch from "connect" to "connect_notify"
Signed-off-by: Mirko Lindner <mirko@sharism.cc>
This commit is contained in:
parent
93a9bc198d
commit
7a95279f5e
@ -39,9 +39,13 @@ main_window::main_window()
|
||||
|
||||
void main_window::connect_all()
|
||||
{
|
||||
(*this).add_events( Gdk::BUTTON_PRESS_MASK ) ;
|
||||
log_debug("connecting all");
|
||||
(*this).press_id = signal_key_press_event().connect(sigc::mem_fun(*this,&main_window::on_my_key_press_event));
|
||||
(*this).release_id = signal_key_release_event().connect(sigc::mem_fun(*this,&main_window::on_my_key_release_event));
|
||||
// (*this).press_id = signal_key_press_event().connect(sigc::mem_fun(*this,&main_window::on_my_key_press_event));
|
||||
// (*this).release_id = signal_key_release_event().connect(sigc::mem_fun(*this,&main_window::on_my_key_release_event));
|
||||
// (*this).press_id =
|
||||
(*this).press_id = (*this).signal_key_press_event().connect_notify(sigc::mem_fun(*this,&main_window::on_notify_key_press_event));
|
||||
(*this).release_id = (*this).signal_key_press_event().connect_notify(sigc::mem_fun(*this,&main_window::on_notify_key_release_event));
|
||||
log_debug((*this).press_id << " " << (*this).release_id);
|
||||
}
|
||||
|
||||
@ -64,6 +68,11 @@ bool main_window::actions(int key)
|
||||
static int key_s = 115;
|
||||
static int key_t = 116;
|
||||
static int key_f1 = 65470;
|
||||
static int left = 65361;
|
||||
static int top = 65362;
|
||||
static int right = 65363;
|
||||
static int bottom = 65364;
|
||||
|
||||
|
||||
// key commands only available if ctrl pressed
|
||||
if ((ctrl_state == 1) && ((*this).press_id == 1))
|
||||
@ -106,8 +115,9 @@ bool main_window::actions(int key)
|
||||
|
||||
}
|
||||
|
||||
bool main_window::on_my_key_press_event(GdkEventKey *Key)
|
||||
void main_window::on_notify_key_press_event(GdkEventKey *Key)
|
||||
{
|
||||
|
||||
if (Key->keyval == gdk_keyval_from_name("Control_R"))
|
||||
{
|
||||
ctrl_state = 1;
|
||||
@ -116,20 +126,42 @@ bool main_window::on_my_key_press_event(GdkEventKey *Key)
|
||||
{
|
||||
actions(Key->keyval);
|
||||
}
|
||||
// log_debug("Key Presssed is " << Key->keyval);
|
||||
return true;
|
||||
log_debug("Key Presssed is " << Key->keyval);
|
||||
}
|
||||
|
||||
bool main_window::on_my_key_release_event(GdkEventKey *Key)
|
||||
void main_window::on_notify_key_release_event(GdkEventKey *Key)
|
||||
{
|
||||
if (Key->keyval == gdk_keyval_from_name("Control_R"))
|
||||
{
|
||||
ctrl_state = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// bool main_window::on_my_key_press_event(GdkEventKey *Key)
|
||||
// {
|
||||
// if (Key->keyval == gdk_keyval_from_name("Control_R"))
|
||||
// {
|
||||
// ctrl_state = 1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// actions(Key->keyval);
|
||||
// }
|
||||
// log_debug("Key Presssed is " << Key->keyval);
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// bool main_window::on_my_key_release_event(GdkEventKey *Key)
|
||||
// {
|
||||
// if (Key->keyval == gdk_keyval_from_name("Control_R"))
|
||||
// {
|
||||
// ctrl_state = 0;
|
||||
// }
|
||||
//
|
||||
// return true;
|
||||
// }
|
||||
|
||||
bool main_window::quit()
|
||||
{
|
||||
hide();
|
||||
|
@ -35,8 +35,10 @@ class main_window : public Gtk::Window
|
||||
private:
|
||||
bool actions(int);
|
||||
int ctrl_state;
|
||||
bool on_my_key_press_event(GdkEventKey *event);
|
||||
bool on_my_key_release_event(GdkEventKey *event);
|
||||
// bool on_my_key_press_event(GdkEventKey *event);
|
||||
void on_notify_key_press_event(GdkEventKey *event);
|
||||
void on_notify_key_release_event(GdkEventKey *event);
|
||||
// bool on_my_key_release_event(GdkEventKey *event);
|
||||
bool quit();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user