void SetKeyWindow::MessageReceived(BMessage* msg){ switch(msg->what){ case SET: key = control1->GetKey(); mod = control1->GetMod(); key2 = control2->GetKey(); mod2 = control2->GetMod(); KeyBind.Install(menu, KeyBind.GetID(index), key, mod, key2, mod2, message); parent->LockLooper(); parent->Pulse(); parent->UnlockLooper(); Quit(); break; case CLEAR1: mod = key = 0; control1->SetBinding(key,mod); break; case CLEAR2: mod2 = key2 = 0; control2->SetBinding(key2,mod2); break; default: BWindow::MessageReceived(msg); } }
void SetKeyWindow::MessageReceived(BMessage* msg) { switch(msg->what) { case SET: { KeyBind* key = new KeyBind(); key->key = control1->GetKey(); key->mod = control1->GetMod(); key->altKey = control2->GetKey(); key->altMod = control2->GetMod(); key->label = gKeyBind->GetLabel(index); key->message = MessageBuilder(message); key->isMenuItem = menu; gKeyBind->AddKeyBind(key); if (parent->LockLooper()) { parent->Pulse(); parent->UnlockLooper(); } Quit(); break; } case CLEAR1: mod = key = 0; control1->SetBinding(key,mod); break; case CLEAR2: mod2 = key2 = 0; control2->SetBinding(key2,mod2); break; default: BWindow::MessageReceived(msg); } }
void SetKeyWindow::MessageReceived(BMessage* msg) { switch(msg->what) { case SET: { KeyBind* key = new KeyBind(); key->key = control1->GetKey(); key->mod = control1->GetMod(); key->label = FaberShortcut::KeyBindAt(index)->label; key->message = FaberShortcut::KeyBindAt(index)->message; key->itemType = FaberShortcut::KeyBindAt(index)->itemType; FaberShortcut::AddKeyBind(key); if (parent->LockLooper()) { parent->Pulse(); parent->UnlockLooper(); } Quit(); break; } case CLEAR1: mod = key = 0; control1->SetBinding(key,mod); break; case CLEAR2: mod2 = key2 = 0; control2->SetBinding(key2,mod2); break; default: BWindow::MessageReceived(msg); } }