w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to change "activity in window" color in byobu
Sure! You can set it like this, in your ~/.byobu/.tmux.conf: set -g window-status-activity-bg red For a complete list of color options, refer to tmux.1 and specifically its OPTIONS section Full disclosure: I am the author and maintainer of Byobu.

Categories : Misc

Windows Phone button press not doing any press when using Phone Accent Brush
You need to create a new template for the Button and change the color there. In blend, select your button, click the menu item "Object"->"Edit Template"->"Edit a Copy..." and a new template is created. Change tke background color for the Normal state.

Categories : C#

I need a div box to press right against another div box
Probably a margin issue. Try .navigation { margin-right: 0px; }. Unless your navigation is on the right side, then use margin-left. You may also have to adjust the margin of the content section. All of the "content" in an element takes up only a small part of that element's screen space. The rest is for padding, border, and margin. These can each be adjusted with CSS via padding: 10px;, border: 5in;, margin: 3pt; respectively (obviously you can use whatever size values you want). You can also manipulate individual sides, such as padding-right: 10px; padding-top 5px; If adjusting the navigation's margin doesn't give the desired result, try adjusting the border and padding as well. There's a good intro to the HTML box model here

Categories : CSS

what value will be passed when i press the key a
No signal will be raised. The purpose of signals is to inform about a special condition outside normal program flow. Processing input, like the letter A, is part of normal program flow. These two are completely separate, and have different goals. If you're on UNIX, type man signal on your console.

Categories : C

After press a key, view go down, only in S3
Does the problem still occur if you use a different keyboard app? If the problem is limited to only the Samsung keyboard, it may be the keyboard that is at fault, in which case there is probably little you can do about it.

Categories : Java

how to press a key in scheme
In Scheme, this will depend heavily on the interpreter in use. For example, here's a Racket sample taken from Rosetta Code, it'll simulate the pressing of the k key: #lang racket/gui (define frame (new frame% (label "Example") (width 300) (height 300))) (define simulate-key-canvas% (class canvas% (define/public (simulate-key key) (send this on-char key)) (define/override (on-char key) (displayln (send key get-key-code))) (super-new))) (define canvas (new simulate-key-canvas% (parent frame))) (send frame show #t) (send canvas simulate-key (new key-event% (key-code #k)))

Categories : C++

VB Simulate a key press
Ok, I ported the c# code from this answer: http://stackoverflow.com/a/7182076/2000557 I don't know VB.Net, but it wasn't too hard to copy over using this guide: http://msdn.microsoft.com/en-us/library/172wfck9.aspx Anyway, I put a button on the form with a click event. Imports System.Runtime.InteropServices Public Class Form1 'this constant represents the hex value for the key to send to user32.dll Const APPCOMMAND_MEDIA_PLAY_PAUSE = &HE0000 'this constant represents which command. Sort of like the function in user32.dll we are calling. Const WM_APPCOMMAND = &H319 'this declares the user32.dll call to SendMessageW we are making Declare Auto Function SendMessageW Lib "user32.dll" Alias "SendMessageW" ( ByVal hWnd As Integer, ByVal Msg As Intege

Categories : Vb.Net

How to pass the tag of a uibutton on press
Event handlers do not pass a tag by itself, they pass the entire button: UIButton *deleteButton = [[UIButton alloc]initWithFrame:CGRectMake(230, dateLabel.frame.origin.y, 70, 27)]; [deleteButton addTarget:self action:@selector(deleteButtonPressed:) forControlEvents:UIControlEventTouchDown]; [deleteButton setBackgroundImage:[UIImage imageNamed:@"delete.jpg"] forState:UIControlStateNormal]; [deleteButton setTag:i]; Now you can get the tag from the button passed in like this: -(void)deleteButtonPressed:(UIButton*)button { NSLog(@"Button Pressed, tag=%i", button.tag); }

Categories : Objective C

C/C++ program to press key every X seconds
In windows, this is pretty easy. Make a C++ console program. Inside your program, you'll need to search all the "windows" in Windows. Microsoft calls these windows window handles (HWND). You can search through them all with FindWindowEx: http://msdn.microsoft.com/en-us/library/windows/desktop/ms633500(v=vs.85).aspx. once you find your window (by name), you can send TO the window HWND keypresses. This is done with SendMessage(); Put this in a loop every 2 seconds and you're done! You can find the window you're searching for's properties by using Visual Studio's Spy++. This will let you easily know what window name to search for.

Categories : C++

why do I get the same value of "up down right left" key-press from getch()
The arrow keys were encoded by three characters in Ubuntu. So I changed my code like this to check arrow keys. if(kbhit()){ switch(getch()){ case 0x1b: //For case arrow pressed if(getch() == 0x5b){ switch(getch()){ case 0x41: turn(); break; case 0x44: mv_left(); break; case 0x43: mv_right(); break; case 0x42: mv_down(); break; } } break; } }

Categories : Misc

Change data in div on key press
HTML: <input id='divText' type="text"/> <ul id="list"> <li>ABC</li> <li>XYZ</li> <li>CDE</li> <li>FGH</li> </ul> JS: var index = 0; $('#divText').on("keyup", function(e) { var code = e.which; var max = $('#list').children().length; if (code == 40){ index++; if(index == max){ index = 0; } } else if (code == 38) { index--; if(index < 0){ index = max-1; } } document.getElementById('divText').value = ($('#list').children().eq(index).text()); }); ...i missread the question in the first answer

Categories : Javascript

Send output on key press
getch() from <conio.h>, outputs the ASCII code for the single key that was pressed. You may process the returned value afterwards. Something like this: #include <conio.h> #include <ctype.h> int main() { int myVar = 0; myVar = getch(); if (isdigit(myVar)) { myVar = myVar - '0'; } return 0; } The drawback is that getch() will only read 1 key.

Categories : C++

JavaScript for handling Tab Key press
Having following html: <!-- note that not all browsers focus on links when Tab is pressed --> <a href="http://example.com">Link</a> <input type="text" placeholder="Some input" /> <a href="http://example.com">Another Link</a> <textarea>...</textarea> You can get to active link with: // event listener for keyup function checkTabPress(e) { "use strict"; // pick passed event or global event object if passed one is empty e = e || event; var activeElement; if (e.keyCode == 9) { // Here read the active selected link. activeElement = document.activeElement; // If HTML element is an anchor <a> if (activeElement.tagName.toLowerCase() == 'a') // get it's hyperlink al

Categories : Javascript

When I press submit nothing happen
In this line: <form ng-submit="submit()" ng-controller="Ctrl"> You configure to angular execute the submit() function at the controller, but you don't have this function declared. You just need to create the submit function at the controller: $scope.submit = function () { // Put you logic inside the method. } I create a plunker with your code working: Plunker

Categories : Angularjs

php if else in word press template - is this php?
This is php too. Just another way of writing an if-condition. See this link for further information: http://php.net/manual/de/control-structures.elseif.php

Categories : Wordpress

Timed button press
start timer loop after this point get time to variable if button press multiplier=1-(abs(time-400)/400) if multiplier < 0 multiplier = 0 clear timer get time to variable print (128*multiplier)*(100/(time+100))

Categories : C++

How to receive TAB key press in edit box?
You can handle the CN_KEYDOWN message: procedure TfrmEnableVIPMode.AccountNumberWindowProc(var Message: TMessage); begin case Message.Msg of CN_KEYDOWN: if TWMKey(Message).CharCode = VK_TAB then .... end; FOldAccountNumberWindowProc(Message); end; It is also possible to detect the key down message at the form level, without subclassing the edit: procedure TfrmEnableVIPMode.CMDialogKey(var Message: TCMDialogKey); begin if (Message.CharCode = VK_TAB) and (ActiveControl = edAccountNumber) then ... inherited; end;

Categories : Delphi

Press button on webbrowser
Got it working, quick and dirty maybe you can write it a little bit more graceful ;-) UPDATE: I´ve read your Question that you asked before, and updated the code accordingly. With this piece of code all Videos of a channel gets loaded (this may take a while with the webbrowserControl) private void button1_Click(object sender, EventArgs e) { bool found = true; while (found) { if (webBrowser1.ReadyState == WebBrowserReadyState.Complete) { found = ClickLoadMoreButton(); Application.DoEvents(); } } } private bool ClickLoadMoreButton() { var buttons = webBrowser1.Document.GetElementsByTagName("button"); foreach (HtmlElement el in buttons) { var firstChild = el.FirstChild; if (firstChild != null)

Categories : C#

dojo aspect and key press
dojo.aspect can't connect to events, only functions. However you should be able to aspect to a function that is handling that event, and steal its args. aspect.after(drawingToolbar, "someHandlerFunctionWithTheEventArg", function(args){ // access the event from the args here }, true);

Categories : Javascript

Detecting key press using getchar()
A caret character in front of another character is an escape sequence for a control character (one of the characters with code points 0 to 31). ^[ is an escape character named ESC and usually introduces escape sequences for your terminal. This is what your keyboard sends when you hit the up arrow.

Categories : C

JButton Press (Not Release)
A click means that a button has been pressed and released. A click event is triggered when a button is clicked and only if the button is still armed(mouse within the bounds of the button) when mouse is released. To handle the pressed event, use the low-level MouseListener btn.addMouseListener(new MouseListener() { @Override public void mousePressed(MouseEvent e) { //do some stuff } /*Override other methods*/ }); Or better use a MouseAdapter btn.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { //do some stuff } /*No need to override other methods, `MouseAdapter` already does it*/ });

Categories : Java

"Press Any Key to Continue" function in C
Use getch(): printf("Let the Battle Begin! "); printf("Press Any Key to Continue "); getch(); Windows alternative should be _getch(). If you're using Windows, this should be the full example: #include <conio.h> #include <ctype.h> int main( void ) { printf("Let the Battle Begin! "); printf("Press Any Key to Continue "); _getch(); } P.S. as @Rörd noted, if you're on POSIX system, you need to make sure that curses library is setup right.

Categories : C

run function on JButton press
I've adapted my comment into an answer. The actionPerformed method of those event listeners are invoked on Swing's event dispatch thread, and since you're entering into an infinite loop, it'll cause the GUI to freeze. You could create a thread inside of your actionPerformed method and do your work inside of the new thread. Though the next issue you'd run into is finding a nice way to stop the thread whenever the user presses the stop button. What's cool is that you've already got all the logic to do this in your code. So getting it to work is as simple as changing: start_button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { start_button.setEnabled(false); stop_button.setEnabled(true);

Categories : Java

Using earphone key press event
Use the ACTION_MEDIA_BUTTON and ACTION_AUDIO_BECOMING_NOISY (volume loud control). But be aware that you shouldnt have another headset app running in the background as it can take a higher priority over yours. Refer this for more details on the know how's

Categories : Android

vb.net enter key press on a button
I don't think you have anything to code.. If your focus is on a button and you press ENTER, the Button1_Click event will fire.. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click MsgBox("DO SOMETHING") End Sub That's the case if your focus is on the button. And if ever you wish to fire your event wherever your focus is, the your code should be fitted in the Form1_KeyPress() event

Categories : Dotnet

Log every button press / interaction in an iOS App
What exactly you need is Google Analytics. Logging each user interaction is not the proper way. You can use the google analytics to track user interactions within your app.

Categories : IOS

UILongPressGestureRecognizer coordinates of press
CGPoint location = [gesture locationInView:self.view]; Is probably what you are looking for. This gives you a CGPoint of the touched point, according to the self.view coordinates

Categories : IOS

If...then function for button press
You need to keep track of whether you want to disable it or not in some sort of variable. Try this: var disable = true; $('body').on('click', '.icon-lock', function () { var lockedarea = $(this).parents(0).eq(2); $(lockedarea).find('input[type=text],input[type=checkbox],textarea,select').prop('disabled', disable); disable = !disable; });

Categories : Javascript

How to handle key press events in c++
What you describe is not a "console program" per se, but a shell. Also, you don't want to handle incoming events, you rather want to simply read from the command line. To do this, there are various ways. Windows has ReadConsoleInput. The more flexible way though is this one usign getline. int main () { string mystr; cout << "What's your name? "; getline (cin, mystr); return 0; } To make you special thing working you just got to store previous inputs in a std::vector<string> or similar. To read the raw input (without echo) from the console, you should use _getch()

Categories : C++

How to Change data based on key press
try following: echo your list in "li" format, and then copy paste below code to your editor // on keydown on text box $txtInput.on("keyup", function (e) { var txt = $(this).val().toLowerCase(); //for backspace if (e.which == 8) { if (txt.length == 0) { renderList(arrText); } } if (txt.length >= 1) { var filterList = searchInList(arrText, txt); if (filterList.length > 0) { renderList(filterList); } else { console.log("Not Found"); renderList(arrText); } } }); see full example here: http://jsfiddle.net/m25UW/ i hope it helps.

Categories : PHP

EditText long press menu
To avoid showing this menu you have to do a small trick: static { try { Field field = QwertyKeyListener.class.getDeclaredField("PICKER_SETS"); field.setAccessible(true); ((SparseArray) field.get(null)).clear(); } catch (Exception ex) { ex.printStackTrace(); } } It will avoid any kind of pick dialogs in all views in your app.

Categories : Android

Wait for button press JButton
You can wait by putting thread to sleep. while(inBattle == false){ try { Thread.sleep(200); } catch(InterruptedException e) { } } // perform operations when inBattle is true Also don't forget to make inBattle volatile

Categories : Java

Using a Long Press Gesture only if certain conditions are met
You may be able to do what you want by subclassing UIGestureRecognizer to make your own gesture recognizer similar to UILongPressGestureRecognizer that listens for accelerometer data in addition to presses of at least 3 second duration.

Categories : IOS

Is there a method or something i can use to make a button press himself?
Based on the structure of your code, the easiest way to do this is: button.doClick(); Another option is to have your ActionListener invoke a method when the button is clicked. Then in your program you can manually invoke the same method.

Categories : Java

Change JPanel after press JButton
So to start, as you have probably figured out, a JFrame can only contain one JPanel in its container. This: frame.getContentPane(); is considered the "top-level" JPanel. You can add and remove panels to the top-level, much in the same way you're doing now. To keep track of multiple panels, I would get a Stack and a push() pop() method wired to your button that would at first push all panels onto the master JPanel, and then pop off from the stack and remove the corresponding JPanel from the proverbial stack in the master container. setVisible() can work, but if you have multiple Panels, the top-most panel can "hide" the panels underneath itself, leading to unexpected results from setVisible(). Swing is tough. Here's the docs that back this up: Top-Level Containers

Categories : Misc

Capture Power Key press in android?
You are probably missing the permission in the manifest that allows your application to override the default behaviour for the power key, it is also important to return something if you've handled the event to prevent the default behaviour. <uses-permission android:name="android.permission.PREVENT_POWER_KEY" /> There's further discussion here So your code would be: @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(KeyEvent.KEYCODE_POWER == event.getKeyCode()){ return true;//If event is handled, falseif } return super.onKeyDown(keyCode, event); } If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false.

Categories : Android

How to press a button with selenium and xpath
Use find_element_by_xpath. xpath = 'html/body/div[6]/div[1]/div/div[3]/div/div[2]/table/tbody/tr/td[1]/a[3]/span' driver.find_element_by_xpath(xpath).click()

Categories : Python

App crashes whenever i press a button in actionbar
setContentView() should really only be called once, in onCreate(). Otherwise every time you call it you will need to populate all your view references again. Don't call it again in onOptionsItemSelected

Categories : Android

Press Enter Key behaves like a Tab in Javascipt
Just add next.select(); .select() selects the content of your input box. You cant find more about .select() here. Here is a DEMO.

Categories : Jquery

My frame gets stuck when i press JButton, why? GUI
The gui freezes, because you are looping in the leave function. If you want your GUi to stay responsive, you should consider using a SwingWorker thread. However, this will not help if your server doesn't send the proper response, but at least the GUI will stay updated and responsive. Try something like this: public void leave() { SwingWorker<Void, Void> w = new SwingWorker<Void, Void>() { @Override protected Void doInBackground() throws Exception { String stat = ""; send("garage2"); try{ while(!stat.equals("garage_released")){ send("check_status"); stat = receive(); Thread.sleep(500); } } catch(IOException

Categories : Java



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