本文整理汇总了C++中press函数的典型用法代码示例。如果您正苦于以下问题:C++ press函数的具体用法?C++ press怎么用?C++ press使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了press函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _sendKeyEventToWebengine
bool _sendKeyEventToWebengine( const int key, QQuickItem* webengineItem )
{
QKeyEvent press( QEvent::KeyPress, key, Qt::NoModifier );
QKeyEvent release( QEvent::KeyRelease, key, Qt::NoModifier );
return _sendEventToWebengine( &press, webengineItem ) &&
_sendEventToWebengine( &release, webengineItem );
}
示例2: QVBoxLayout
void xwindow::create_wborder(void)
{
lbdr = NULL;
ubdr = NULL;
layout = new QVBoxLayout(this);
Q_CHECK_PTR(layout);
layout->setMargin(0);
if(pflags & WindowManager::SmallFrame)
{
midmove = new wframe(this);
Q_CHECK_PTR(midmove);
midmove->setFixedHeight(defaults::lowerborderheight);
layout->addWidget(midmove);
connect(midmove, SIGNAL(left_press(QMouseEvent *)), SLOT(press_move(QMouseEvent *)));
connect(midmove, SIGNAL(left_release(QMouseEvent *)), SLOT(release_move(QMouseEvent *)));
connect(midmove, SIGNAL(right_press()), SLOT(s_maximize()));
connect(midmove, SIGNAL(mid_press()), SLOT(show_info()));
connect(midmove, SIGNAL(mouse_move(QMouseEvent *)), SLOT(move_move(QMouseEvent *)));
}
else
{
ubdr = new uborder((transfor == None), this);
Q_CHECK_PTR(ubdr);
layout->addWidget(ubdr);
midmove = ubdr->midframe;
if(transfor == None)
{
connect(ubdr->leftframe, SIGNAL(right_press()), SLOT(t_maximize()));
connect(ubdr->leftframe, SIGNAL(mid_press()), SLOT(toggle_tiled()));
connect(ubdr->leftframe, SIGNAL(left_press()), SLOT(iconify()));
}
connect(ubdr->rightframe, SIGNAL(press()), SLOT(wdestroy()));
connect(midmove, SIGNAL(right_press()), SLOT(s_maximize()));
connect(midmove, SIGNAL(left_press(QMouseEvent *)), SLOT(press_move(QMouseEvent *)));
connect(midmove, SIGNAL(left_release(QMouseEvent *)), SLOT(release_move(QMouseEvent *)));
connect(midmove, SIGNAL(mid_press()), SLOT(show_info()));
connect(midmove, SIGNAL(mouse_move(QMouseEvent *)), SLOT(move_move(QMouseEvent *)));
}
layout->addStretch();
if(! (pflags & WindowManager::NoResize))
{
lbdr = new lborder(this);
Q_CHECK_PTR(lbdr);
layout->addWidget(lbdr);
connect(lbdr->leftframe, SIGNAL(press(QMouseEvent *)), SLOT(press_leftresize(QMouseEvent *)));
connect(lbdr->leftframe, SIGNAL(release(QMouseEvent *)), SLOT(release_leftresize(QMouseEvent *)));
connect(lbdr->leftframe, SIGNAL(mouse_move(QMouseEvent *)), SLOT(move_leftresize(QMouseEvent *)));
connect(lbdr->rightframe, SIGNAL(press(QMouseEvent *)), SLOT(press_rightresize(QMouseEvent *)));
connect(lbdr->rightframe, SIGNAL(release(QMouseEvent *)), SLOT(release_rightresize(QMouseEvent *)));
connect(lbdr->rightframe, SIGNAL(mouse_move(QMouseEvent *)), SLOT(move_rightresize(QMouseEvent *)));
connect(lbdr->midframe, SIGNAL(press(QMouseEvent *)), SLOT(press_midresize(QMouseEvent *)));
connect(lbdr->midframe, SIGNAL(release(QMouseEvent *)), SLOT(release_midresize(QMouseEvent *)));
connect(lbdr->midframe, SIGNAL(mouse_move(QMouseEvent *)), SLOT(move_midresize(QMouseEvent *)));
}
示例3: press
size_t Keyboard_::write(uint8_t c)
{
uint8_t p = 0;
p = press(c); // Keydown
release(c); // Keyup
return (p); // Just return the result of press() since release() almost always returns 1
}
示例4: press
size_t DefaultKeyboardAPI::write(ConsumerKeycode k)
{
// Press and release key (if press was successfull)
auto ret = press(k);
if(ret){
release(k);
}
return ret;
}
示例5: press
void PianoKey::mouseReleaseEvent(QGraphicsSceneMouseEvent *event){
if(event->button() == Qt::LeftButton){
press(false);
((KeyScene*)scene())->keyInput(id);
QTimer::singleShot(latency,keysound,SLOT(stop()));//timer cannot function in multithreat
//keythread->quit();
}
}
示例6: press
size_t KeyboardAPI::write(uint8_t k)
{
// Press and release key (if press was successfull)
auto ret = press(k);
if(ret){
release(k);
}
return ret;
}
示例7: press_key
void press_key( int vk_code, BOOL down )
{
INPUT input;
init_input( &input );
input.ki.wVk = vk_code;
input.ki.wScan = MapVirtualKey( vk_code, MAPVK_VK_TO_VSC );
set_down( &input, down );
push_to_ignore_keys( vk_code, down );
press( &input );
}
示例8: press
size_t USBKeyboard::writeKey(uint16_t key, uint16_t modifiers)
{
// Keydown
uint8_t p = press(key, modifiers);
// Keyup
uint8_t r = release(key, modifiers);
(void)r;
// just return the result of press() since release() almost always returns 1
return (p);
}
示例9: press
void wframe::mousePressEvent(QMouseEvent *event)
{
emit press(event);
emit press();
if(event->button() == Qt::RightButton)
{
emit right_press();
}
else if(event->button() == Qt::LeftButton)
{
emit left_press(event);
emit left_press();
}
else if(event->button() == Qt::MidButton)
{
emit mid_press();
}
}
示例10: write
size_t HIDKeyboard::write(uint8_t c)
{
if (press(c)) {
release(c); // Keyup
return 1;
}
else {
return 0;
}
}
示例11: release
void Button::toggle()
{
if( _pressed )
{
release();
}
else
{
press();
}
}
示例12: press
// add m's modifiers where this dontcare
void Modifier::add(const Modifier &i_m)
{
for (int i = 0; i < Type_end; ++ i) {
if (isDontcare(static_cast<Modifier::Type>(i)))
if (!i_m.isDontcare(static_cast<Modifier::Type>(i)))
if (i_m.isPressed(static_cast<Modifier::Type>(i)))
press(static_cast<Modifier::Type>(i));
else
release(static_cast<Modifier::Type>(i));
}
}
示例13: resolve_delays_keys
void resolve_delays_keys()
{
int i = 0;
for ( i = 0; i < delayed_keys_count; i += 1 )
{
INPUT input;
init_input( &input );
key2input( &delayed_keys[ i ], &input );
press( &input );
}
reset_delayed_keys();
}
示例14: quit
void quit(void)
{
move(12,35);
outs("[47m[31m©°¡ª¡ª¡ª¡ª¡ª¡ª¡ª©´[m");
move(13,35);
outs("[47m[31m©¦ [30;42m¶Ô·½Í˳öÁË[m[47m [31m ©¦[m");
move(14,35);
outs("[47m[31m©¸¡ª¡ª¡ª¡ª¡ª¡ª¡ª©¼[m");
refresh ();
bell();
press ();
}
示例15: guess_sequence
std::string guess_sequence(int N) {
std::string p = "";
for (int i = 0; i < 4 * N; ++i) {
p += 'A';
}
int coins = press(p);
std::string S = "";
for (int i = 0; i < N; ++i) {
S += 'A';
}
return S;
}