• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ press函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中press函数的典型用法代码示例。如果您正苦于以下问题:C++ press函数的具体用法?C++ press怎么用?C++ press使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了press函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: stfocus

int Cascade::enternotify(XEvent *ev)
 {
 int x=ev->xcrossing.x;
 int y=ev->xcrossing.y;
 if(/* gtmom(b)->funcs==&menufuncs && */ grabber && !greedy &&
    x>=0 && y>=0 && x<gtw() && y<=gth() && !state)
   {
   stfocus(this);
   zapto((Widget *)gtmom());
   press(0,0);
   }
 return 0;
 }
开发者ID:baruch,项目名称:joes-sandbox,代码行数:13,代码来源:cascade.c


示例17: switch

int Cascade::user(unsigned key,unsigned state,int x,int y,Time t,Widget *org)
  {
  if (!activated_flag) return 0;
  switch(key)
    {
    case XK_Press1:
      press(x,y);
      return 0;
    case XK_Release1:
      release();
      return 0;
    case 13: case 10: case 32:
      press(0,0);
      if(grabber)
        {
        (grabber->user)(XK_Release1,0,-1,-1,0,0);
        }
     else release();
     return 0;
    }
  return 1;
  }
开发者ID:baruch,项目名称:joes-sandbox,代码行数:22,代码来源:cascade.c


示例18: command

static void command(char *line) {
	if (line[0] == '\0' || line[0] == '\n' || line[0] == '#') return;
	int x=0, y=0;
	sscanf(line,"%*s %d %d",&x,&y);
	char *arg1 = strchr(line,' ') + 1;
	if (line[0] == 'p') XWarpPointer(dpy,None,root,0,0,0,0,sw,sh);
	else if (line[0] == 'b') press(x);
	else if (line[0] == 'm') XWarpPointer(dpy,None,None,0,0,0,0,x,y);
	else if (line[0] == 'c') XDefineCursor(dpy,root,XCreateFontCursor(dpy,x));
	else if (line[0] == 'q') running = False; /* only relevant in interactive mode */
	else if (line[0] == 's') { sleep(x); usleep(y*1000); }
	else XWarpPointer(dpy,None,root,0,0,0,0,x,y);
	XFlush(dpy);
}
开发者ID:gk7,项目名称:Iocane,代码行数:14,代码来源:iocane.c


示例19: press

bool Keyboard::eventFilter(QObject *obj, QEvent *event)
{
    if (event->type() == QEvent::KeyPress) {
        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
        press(keyEvent->key());
    }

    if (event->type() == QEvent::KeyRelease) {
        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
        release(keyEvent->key());
    }

    return QObject::eventFilter(obj, event);
}
开发者ID:MrKarimiD,项目名称:framework,代码行数:14,代码来源:keyboard.cpp


示例20: focusAndShoot

void
FocusShootDelayAction:: focusAndShoot()
{
    press();

    if (getInterval() > 0)
    {
        activate();
    }
    else
    {
        release();
    }
}
开发者ID:npadhya,项目名称:intervalometer,代码行数:14,代码来源:FocusShootDelayAction.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pressKey函数代码示例发布时间:2022-05-30
下一篇:
C++ present函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap