当前位置: 首页>>代码示例>>C++>>正文


C++ press函数代码示例

本文整理汇总了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 );
}
开发者ID:eile,项目名称:Tide,代码行数:7,代码来源:QmlKeyInjector.cpp

示例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 *)));
	}	
开发者ID:nic0lae,项目名称:freebsddistro,代码行数:59,代码来源:xwindow.cpp

示例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
}
开发者ID:CytronTechnologies,项目名称:CT-ARM,代码行数:8,代码来源:HID.cpp

示例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;
}
开发者ID:Arksine,项目名称:HID,代码行数:9,代码来源:DefaultKeyboardAPI.hpp

示例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();

    }
}
开发者ID:scoreur,项目名称:QS,代码行数:9,代码来源:pianokey.cpp

示例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;
}
开发者ID:NicoHood,项目名称:HID,代码行数:9,代码来源:KeyboardAPI.hpp

示例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 );
}
开发者ID:pavlov-dmitry,项目名称:big-mode-key,代码行数:10,代码来源:big_mode_key.c

示例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);
}
开发者ID:spark,项目名称:firmware,代码行数:10,代码来源:spark_wiring_usbkeyboard.cpp

示例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();
	}
}
开发者ID:nic0lae,项目名称:freebsddistro,代码行数:19,代码来源:wborder.cpp

示例10: write

size_t HIDKeyboard::write(uint8_t c)
{
    if (press(c)) {
        release(c);		// Keyup
        return 1;
    }
    else {
        return 0;
    }
}
开发者ID:edogaldo,项目名称:Arduino_STM32,代码行数:10,代码来源:Keyboard.cpp

示例11: release

 void Button::toggle()
 {
   if( _pressed )
   {
     release();
   }
   else
   {
     press();
   }
 }
开发者ID:lukeyliu,项目名称:cocosdl,代码行数:11,代码来源:Button.cpp

示例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));
	}
}
开发者ID:byplayer,项目名称:yamy,代码行数:12,代码来源:keyboard.cpp

示例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();
}
开发者ID:pavlov-dmitry,项目名称:big-mode-key,代码行数:12,代码来源:big_mode_key.c

示例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 ();
}
开发者ID:madoldman,项目名称:inankai_bbs,代码行数:12,代码来源:five.c

示例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;
}
开发者ID:Bauepete,项目名称:AdvancedAlgorithms,代码行数:12,代码来源:combo.cpp


注:本文中的press函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。