w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Check if keyboard and mouse are available with Qt
I think Qt in embedded Linux can detect the plug and unplug of an USB Mouse and enable it when USB mouse is plugged in. you can refer following links http://qt-project.org/doc/qt-4.8/qkbddriverplugin.html#details http://qt-project.org/doc/qt-4.8/qmousedriverplugin.html#details http://qt-project.org/doc/qt-4.8/qwsmousehandler.html

Categories : C++

how can I get information about the mouse, keyboard, gamepad in MAC OS
turned himself in, as it so static void MyCreateHIDDeviceInterface(io_object_t hidDevice, IOHIDDeviceInterface122 ***hidDeviceInterface) { io_name_t className; IOCFPlugInInterface **plugInInterface = NULL; HRESULT plugInResult = S_OK; SInt32 score = 0; IOReturn ioReturnValue = kIOReturnSuccess; ioReturnValue = IOObjectGetClass(hidDevice, className); printf("Failed to get class name. ");//print_errmsg_if_io_err(ioReturnValue, "Failed to get class name."); printf("Found device type %s ", className); ioReturnValue = IOCreatePlugInInterfaceForService(hidDevice, kIOHIDDeviceUserClientTypeID,

Categories : Osx

X11 and fake keyboard / mouse events
Yes there is a possibility. All X11-events which are relevant for mouse movements and clicks have a member called "send_event". It is set to "True" if the event was sent by an application. It is "False" if it was generated by the X-Server, i.e. by a user action. If xdotool uses SendEvent for mousclick simulation than you'll be able to detect that using the "send_event" member.

Categories : Linux

Is it possible to control the mouse cursor using keyboard in AS3?
No, that is not possible. The closet you can get is 'faking' events that would typically be dispatched by Mouse input, e.g. dispatchEvent( new MouseEvent(MouseEvent.CLICK) ); You can also hide the cursor and create your own DisplayObject to represent its position.

Categories : Actionscript

Connection to HID USB device (keyboard and mouse) in android
Have you looked at Android Open Access Protocol yet? In the section titled HID Support: The AOA 2.0 protocol adds four new USB control requests to allow the accessory to act as one or more HID input devices to the Android device. Since HID support is done entirely through control requests on endpoint zero, no new USB interface is needed to provide this support. HTH.

Categories : Java

Fake mouse and keyboard input on Android
Is there are way to fake mouse and keyboard input on Android? Only via custom firmware, a rooted device, or via the Android SDK tools. Apps cannot attack other apps via "fake mouse and keyboard input" for obvious security reasons. I have also seen someone faking key inputs per command line is there a way to execute command line commands in an Android application? Fortunately, that will not work, unless you run as root.

Categories : Android

Fade-out controls when there's no keyboard/mouse input
Two independent variables are needed here to indicate, whether the input#sc-url is focused and div#panel is hovered by mouse or not. Then you can handle the timer with these functions: $(function () { var t = null; //timer var is_url_focused = false, is_panel_hovered = false; var panel = $('#panel'); function hide_panel(){ if (t) { clearTimeout(t); } t = setTimeout(function(){ if (is_url_focused || is_panel_hovered) { return; } panel.stop().animate({ opacity:0 },800, function(){ panel.hide(); // == diplay:none }); },2000); } function show_panel(){ panel.show().stop().animate({ opacity:1

Categories : Javascript

Why doesn't my QDeclarativeItem get any mouse/keyboard events?
To get (left) mouse events, all that is needed is to add setAcceptedMouseButtons(Qt::LeftButton); in the TestItem constructor. This is a little surprising as the documentation for the inherited QGraphicsItem::setAcceptedMouseButtons says "By default, all mouse buttons are accepted", but maybe something else in the setup messes with the state. To get keyboard events, setFocus(true) just needs to be invoked. The documentation seems to imply setFlag(QGraphicsItem::ItemIsFocusable,true) should also be called, but it doesn't actually seem to be necessary in my test.

Categories : C++

ComboBox Item Selection Works With Keyboard But Not Mouse
I can't really tell what's wrong from your code however, I'd strongly suggest you to use Snoop to debug your controls (http://snoopwpf.codeplex.com/) By holding Ctrl+Shift and pointing the mouse where you ComboBox is supposed to grab the input you would instantly find out who is having the focus instead of your combo box. You can even change the value of a property, really your best friend for debugging your templates ! EDIT I'm afraid but the code you've posted works for me: <Window x:Class="WpfApplication6.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wpfApplication6="clr-namespace:WpfApplication6" Title="MainWindow" Width="525" Height="3

Categories : C#

Qt::QTableWidget: SIGNAL currentCellChanged: Differ between mouse and keyboard
I assume you're using a regular Designer form class and the table widget is part of that form. In constructor of your form class you should do: ui->tableWidget->viewport()->installEventFilter(this); Add eventFilter method to your class (it reimplements virtual QObject::eventFilter): bool MyForm::eventFilter(QObject* object, QEvent* event) { if (object == ui->tableWidget->viewport()) { if (event->type() == QEvent::KeyPress) { method = method_keyboard; } else if (event->type() == QEvent::MouseButtonPress) { method = method_mouse; } } return false; } In the slot you can check the value of method variable to find out which control was used.

Categories : C++

Duplicate whole method via keyboard shortcut?
Until IDEA does not get a built-in feature like this, you can use this approach (it's pretty quick): Put caret on the method name line or anywhere inside the method itself Ctrl + Minus Ctrl + D Ctrl + Plus Or make a Macro like @CrazyCoder suggested.

Categories : Intellij Idea

How to keep Qt Widgets responsive to keyboard and mouse while handling Windows Events?
You need to either profile that code and speed it up so it doesn't block the event loop, or you need to run that code in a separate thread. For profiling, I recommend looking at valgrind, callgrind, and kcachegrind. As for threads, most Qt applications are single-threaded by default, so if you don't return processing back to the event loop soon enough, UI events will get clogged up in the event loop and not get processed until you return processing to event loop. Creating new threads is pretty easy in Qt. See this example from the Qt Docs on QThread: void MyObject::putWorkerInAThread() { Worker *worker = new Worker; QThread *workerThread = new QThread(this); connect(workerThread, &QThread::started, worker, &Worker::doWork); connect(workerThread, &QThread::f

Categories : C++

Scrolling through Visual Studio Intellisense list without mouse or keyboard arrows
Go get a used Kinect for $30 and map either a voice command or a head gesture to mouse scroll event. The SDK is really easy to use. You could say if head tilt left scroll up or right scroll down. SDK http://www.microsoft.com/en-us/kinectforwindows/develop/developer-downloads.aspx Documentation http://www.microsoft.com/en-us/kinectforwindows/develop/learn.aspx Example Projects http://channel9.msdn.com/coding4fun/kinect You're only limited by your imagination.

Categories : C#

Automating cursor movements, mouse clicks and keyboard inputs in not helping to show that user is present on system
Get a decompiler, crack-open the spying application and see how it is working inside. Only knowing the internal workings, you can create a "workable" any-spying program. But I would not bother with emulation of the activity, but rather spoof the way it reports to the server. However, depending on where you live, it might be illegal to do these things and I would not recommend cheating your employer. And if spying gets on your nerves I'd also suggest to brush up your CV and start searching for a new job.

Categories : C#

Simulate / emulate pressing keyboard button or mouse button in jquery
You can do: $('a').trigger('click'); // Mouse click $(document).trigger('keydown'); // Keyboard But you will need to add the events in order to be able to trigger them: $('a').on('click',function() { // do something }); $('document').on('keydown',function() { // do something });

Categories : Jquery

OpenGL Zoom in / Zoom out with Mouse/Keyboard
Personally I always liked the NeHe tutorials, many different examples are available with source code in many programming languages. The tutorial is in C but the code can be downloaded in other languages and method names are very similar usually. http://nehe.gamedev.net/ Regarding your zooming, try to translate your model coordinates into(closer to) the screen taking into account the point your zooming to (or from) (can be cursor location or just the center of the model). Another way might be to adjust the viewport but I recommend translating the model.

Categories : Java

Google Plus share on ios directs to web page with broken links in share and cancel button
Something must be wrong with your google plus api setup. Google Plus is trying to reopen your app using a URL scheme that looks something like youdefinethis://somethingtodoinyourapp If you have setup google plus to use a specific url scheme to reopen your app, you need to define this same scheme in your project settings under Info -> URL Types. This is a hard problem to solve because of the lack of information you can give us without risking your privacy. Did you complete all the instructions that are listed here?: https://developers.google.com/+/mobile/ios/getting-started

Categories : IOS

How can I share share read/write access to a file within the same process, but forbid it externally?
Files are generally not for multi-user interactions such as this. A database is what is needed here. Then the data you need written can be saved to the database and all the synchronous handling would now be the databases responsibility. If you still require a file, after the data has been input, it would be an idea to generate the file when needed based off the database data.

Categories : C

JS Game Programming - Using keyboard events for bluetooth keyboard/iCade with iPad browser?
Apparently, after researching it, this is not possible - only OS calls can do this, and none of them have a JS interface, even via webkit. What I will do is give the option to modify the canvas size for the bar.

Categories : Javascript

Is it possible to use Autohotkey with an Apple Mac Keyboard to translate OSX keyboard shortcuts to the Windows 7 equivalents on a PC?
Yes, this is possible. You would need to run this script at startup. Source #InstallKeybdHook #SingleInstance force SetTitleMatchMode 2 ; #Include Apple Wired Keyboard.ahk ; Required for Eject Button. See Source. SendMode Input ; -------------------------------------------------------------- ; NOTES ; -------------------------------------------------------------- ; ! = ALT ; ^ = CTRL ; + = SHIFT ; # = WIN ; media/function keys all mapped to the right option key RAlt & F7::SendInput {Media_Prev} RAlt & F8::SendInput {Media_Play_Pause} RAlt & F9::SendInput {Media_Next} RAlt & F10::SendInput {Volume_Mute} RAlt & F11::SendInput {Volume_Down} RAlt & F12::SendInput {Volume_Up} ; swap left command/windows key with left alt LWin::LAlt LAlt::LWin ; add a semicolon in f

Categories : Windows

How to show numeric keyboard (tab from simple text keyboard) on an EditText
Ok this might work. Use a "onTextChangeListener" in your EditText so when the lenght or some determinative string has been recorded the keyboard will switch. I Have a project where I do something like this: yourEditText.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } //Check after user finished writting @Override public void afterTextChanged(Editable s) { //if the lenght of the editText is > 3... if (s.length()>=3){ yourTextView.se

Categories : Android

In iOS, how do I get keyboard information to prevent keyboard overlay of text fields?
One way you can do this is that instead of setting the text field's frame in the begin editing, you can iterate through your text fields checking the isFirstResponderproperty, and move the frame of the one that is first responder. You can do all that in your method where you get the keyboards frame.

Categories : IOS

Adding my own keyboard instead of default keyboard in Android device as input
You should first take a look here. Then continue with this thread here, as stated there: Some tips: Read this tutorial: Creating an Input Method clone this repo: LatinIME An inputMethod is basically an Android Service, so yes, you can do HTTP and all the stuff you can do in a Service. You can open Activities and dialogs from the InputMethod. Once again, it's just a Service. Here's another tutorial on the topic. I hope all this is helpful for you. Cheers

Categories : Android

Is there any way to share on google plus stream, without entering to share dialog ..?
Too low of a reputation to comment, but check out this answer Where it states UPDATE 3: Google just announced Google+ History. You can use it to write "moments" (which are private by default) but can then be made public by sharing them directly to your stream and/or your profile. One of the moment types is CommentActivity.

Categories : Iphone

Google plus share button callback (when share is succeded)
https://developers.google.com/+/web/share/ onendinteraction function(jsonParam) If specified, this function is called when the interaction bubble disappears. You can use this callback function to modify your page, such as resuming a video, when the bubble closes. This function accepts a single parameter, which is identical in structure to the parameter passed to onstartinteraction.

Categories : Javascript

Facebook Doesn't appear on share windows when trying to share an Image
after correcting my childish mistake (see EDIT part in question) and Using this code snippet I finally solved this problem. if anybody knows whats the difference between using contentValue and my approach please share that with me.

Categories : Android

No outline on mouse focus but still have outline on keyboard focus?
Browsers use the CSS outline property to show which element has the focus, as you might already know. So, in jQuery, you might use: $(document).ready(function() { $("body").on("mousedown", "*", function(e) { if (($(this).is(":focus") || $(this).is(e.target)) && $(this).css("outline-style") == "none") { $(this).css("outline", "none").on("blur", function() { $(this).off("blur").css("outline", ""); }); } }); }); Explanation: This function looks for the mousedown event on any element. This event is delegated, meaning it will apply to elements currently on the page as well as any created dynamically in the future. When the mouse is clicked over the element, its CSS outline property is set to none; the outline is removed.

Categories : Javascript

Custom iOS keyboard repositioned by undocked system keyboard
Undocking by longPress then move is a default gesture of iPad keyboard (default and custom) if undocking setting is on. With custom keyboard, this gesture assign to right lower conner of keyboard. Check when undock keyboard from this and resign or modify you custom keys.

Categories : IOS

Physical keyboard doesn't disable when using a virtual keyboard
First, I feel duty-bound to say: virtual keyboards are almost always terrible, and with the exception of touchscreen-only kiosks, there are virtually no reasons to use them. So, please think of your users. But, that said: to disable key presses in an input, return false from the keypress handler: $("input").on("keypress", function() { return false; });

Categories : Javascript

How do I mouse scroll in Emacs in the terminal? I haven't gotten mouse-wheel-mode to work
Edit 2: Just tried running emacs -Q -nw in xterm. In this situation M-x xterm-mouse-mode makes it possible for me to scroll large buffers with the mouse wheel. So it is possible after all. Can't say why it doesn't work for you without further info. Original answer: As I understand it, emacs run in a terminal can only get very limited use of the mouse, and only with some terminal emulators. xterm-mouse-mode might help, but even then I don't think you can get wheel scrolling, just clicks. Edit: since you're ssh-ing in, you could try using a GUI version of emacs, either on the remote machine, after connecting via ssh -x, or by running emacs locally and using tramp to do the ssh connection. You get all the mouse features this way, shouldn't need any custom tweaking.

Categories : Emacs

jquery mouse over and out event firing when mouse is moved quickly over image
I think it would be better to use .mouseenter(). In that case you just get 1 event, while with mouseover you get many. So your code could be: $(document).ready(function() { $("#icon").mouseenter(function() { $(this).fadeOut(1000); }).mouseout(function() { $(this).fadeIn(1000); }); }); You could also do this just with CSS: #icon { transition: opacity 1s; } #icon:hover { opacity:0; } <img src="http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon@2.png?v=fde65a5a78c6" id="icon" alt="" />

Categories : Jquery

Javascript calculate the number of elements under the mouse pointer as the mouse moves
If you don't mind using jQuery -- Use the technique in this question -- jQuery: how do I get the element underneath my cursor? -- to trigger the update whenever the mouse moves over a new element. Then you can use this query method -- .parents() -- to get an array of all of the parents of the element. The number of elements will be the length of the array + 1 (the element itself). If you don't want to count <html> and <body> then you can subtract two.

Categories : Javascript

Fabric.js – element is undefined when I move the mouse holding down the mouse button
I'm not all that familiar with Fabric.js, so there might be a better solution, but here's my take on it: canvas.on('mouse:move',function(options){ var pt = { x: options.e.clientX, y: options.e.clientY }; if( circle.containsPoint(pt) ) { if( !circle.mouseOver ) { circle.mouseOver = true; console.log( 'over circle, yo' ); circle.set('opacity', 0.5); canvas.renderAll(); } } else if( circle.mouseOver ) { circle.mouseOver = false; circle.set('opacity', 1.0); canvas.renderAll(); } }); Basically we're doing all the heavy lifting to see if we're over the object of interest, and changing its properties when we first mouse over it, and then again when we mouse out of it. You can combine this

Categories : Javascript

Handling mouse wheel and keyboars events while a mouse button is pressed
Instead of a global hook, you can go one level up and use IMessageFilter() instead. This will work for when your application is focused only. Not sure what level you need to work at... public partial class MyUserControl : UserControl { private MyFilter filter; public MyUserControl() { InitializeComponent(); filter = new MyFilter(); filter.LButtonScroll += new MyFilter.LBUTTONSCROLLDELEGATE(filter_LButtonScroll); Application.AddMessageFilter(filter); } private void filter_LButtonScroll() { Console.WriteLine("WM_MOUSEWHEEL while LBUTTONDOWN"); } private class MyFilter : IMessageFilter { private bool LBUTTONDOWN = false; private const int WM_LBUTTONDOWN = 0x201; private const int WM_LBUT

Categories : C#

In a PictureBox, drawing a temporary circle on mouse down, to follow the mouse, until the mouseUp event is detected
You need to look at the PictureBox's Paint Event also, it is better to do all of your graphics in the Paint event since you do not have to worry about disposing the Graphic Object.. See if this is what you were wanting. Edit: added code to retain points and also to clear them. public partial class Form1 : Form { bool mDown; SolidBrush sbGray = new SolidBrush(Color.Gray); SolidBrush sbGreen = new SolidBrush(Color.LimeGreen); SolidBrush sbTemp; Point mPosition = new Point(); public List<Point> points = new List<Point>(); public Form1() { InitializeComponent(); pictureBox1.Image = Image.FromFile(@"C:TempTest.jpg"); } private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseB

Categories : C#

What is the difference between tap , mouse left button down and mouse pressed events?
For all practical purposes, the Tap and Click events are equivalent for a Button. The Click event was originally defined in Silverlight for desktop Windows and it is only defined for the Button control (and derivatives such as HyperlinkButton). You can think of the Click event as the "traditional" way to handle a Button press. The Tap event was added to the framework in Windows Phone 7.1 (Mango). Tap is defined in the UIElement class, which is the parent of many types of controls. You can handle a Tap event in a TextBlock, Image, and many other controls. Button is subclassed from UIElement as well, and thus can also receive Tap events. It is redundant that a Button can receive both Tap and Click events. reference if u also read the second answer u can get some more info

Categories : C#

Animated gif does not play - mouse listener - event mouse entered
Don't use a MouseListener for this, just set up the icon using, setPressedIcon(Icon), setRolloverIcon(Icon) etc. See this answer for an example. Don't attempt to load the image 'as needed', but instead load them & set them up on the button when it is initialized. Change getClass().getResource("images\button_1_hover.gif") togetClass().getResource("/images/button_1_hover.gif") Change the method used to load the image. ImageIO will not typically load an animated GIF correctly. See Show an animated BG in Swing for details. Change code of the form catch (Exception e) { .. to catch (Exception e) { e.printStackTrace(); // very informative! ..

Categories : Java

How to make keyboard event using javascript without keyboard
This is not possible as it violates a browser's sandbox capabilities. However, there are workarounds such as - http://andrew.hedges.name/experiments/fullscreen/

Categories : Javascript

jQuery - Need to remove the value on mouse leave but not on mouse enter
Just use a flag for it: var hasBeenClicked = false; $('.stars').on('mouseleave', function(e) { if(hasBeenClicked) { //let the stars value } else { //reset the stars } }); $('.stars .star').on('click', function() { //set the rating hasBeenClicked = true; });

Categories : Javascript

Javascript effects on mouse enter and mouse leave
I guess you want to remove the duration so the opacity changes instantly. http://api.jquery.com/fadeTo/ Just make 0 the 'duration' argument ( the first one ) $(document).ready(function () { $(".teamImage") .fadeTo(0, 0.8) .mouseleave(function () { $(this).fadeTo(0, 0.8); }) .mouseenter(function () { $(this).fadeTo(0, 1); }); })

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.