w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to prevent images from resizing while changing the browser zoom by "Ctrl -" or "Ctrl +"?
There is no surefire way of doing this. The only suggestions that I could make will require extensive programming knowledge in javascript and even then, there is no guarantee this will work. Unless it breaks the page, I don't think you need to worry about this. Moreover you might just kill the user's experience by trying to prevent him from rescaling You can check this question for some solutions that might and I say this with a packet of salt might help Catch browser's "zoom" event in JavaScript

Categories : HTML

Jump with Ctrl-I doesn't work in my MacVim, but Ctrl-O works?
<C-i> and <Tab> are strictly equivalent. You are actively overriding <Tab> and therefore <C-i> in ~/.vim/plugin/settings/Settings.vim. If you want <C-i> to work normally don't override it (or <Tab>). Simple. Unless you have a very specific reason to do so, you don't need to put anything in ~/.gvimrc. The normal place for your settings/mappings is ~/.vimrc, there's no valid reason to put them anywhere else (~/.vim/plugin/settings/Settings.vim or wherever). Use nnoremap <C-+> <C-o> if you want <C-+> to do what <C-o> does, whatever benefit you think you will get from doing that.

Categories : Vim

Why can't I press CTRL+A or CTRL+Backspace in my textbox?
As Hans Passant said Ctrl+A doesn't actually work in that mode, you have to implement it yourself. Not hard with a KeyDown event handler. To Implement what you want, you can use the KeyDown event of the textbox private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.Control) { if (e.KeyCode == Keys.A) { textBox1.SelectAll(); } if (e.KeyCode == Keys.Back) { e.SuppressKeyPress = true; int selStart = textBox1.SelectionStart; while (selStart > 0 && textBox1.Text.Substring(selStart - 1, 1) == " ") { selStart--; } int prevSpacePos = -1;

Categories : C#

Assign command ctrl+z/ctrl+y to button?
You would have to be using JavaScript to detect key presses. Since you are already using jQuery in your application, consider the following: $(document).keydown(function(e){ if ( e.ctrlKey && e.keyCode == 122 ) { myCtrlZFunction(); } else if( e.ctrlKey && e.keyCode == 121 ) { myCtrlYFunction(); } }); e in the keydown's closure argument is the number code for the key depressed. The code for z is 122, the code for y 121. All you really need to do then is to create your myCtrlZFunction() and myCtrlYFunction() You can see the different keycode values on: http://expandinghead.net/keycode.html

Categories : Javascript

Chrome - Javascript prevent default Ctrl + MouseWheel behavior
Unfortunately, it's impossible to intercept or block the Ctrl + scrollwheel (zoom) event in Chrome. This issue is being tracked at https://code.google.com/p/chromium/issues/detail?id=111059. Star the issue to get notified of (progress) updates.

Categories : Google Chrome

Geb - perform Ctrl + P
You can send non-character key presses using WebDriver's Key.chord() method: import org.openqa.selenium.Keys $("input", name: "firstName") << Keys.chord(Keys.CONTROL, "P") See this section of the manual for more information.

Categories : Grails

BlockInput AND CTRL+ALT+DEL
No. Ctrl-Alt-Del is the Secure Attention Sequence. It's called Secure because the OS always handles it internally. Applications cannot override that. In your case, you don't need to block it anyway. It's not a sequence you type in by accident. Therefore, it's sufficient to detect it. E.g. it would be the only way in which your app would lose focus. So, tell your students not to do it, and fail the test if they still try.

Categories : Delphi

Eclipse ctrl+right does nothing
Eclipse's welcome screen causes this kind of bug in the editor specifically (https://bugs.eclipse.org/bugs/show_bug.cgi?id=426557). Sometimes you can find that when you restart can't move with control+arrow in the editor but you can in other views like console window. You can disable welcome screen or restart eclipse and everything will work again.

Categories : Eclipse

WPF DragDrop with ctrl key down
You don't need to detect key presses to accomplish what you're after. It all depends on what the value of the (DragEventArgs).AllowedEffects property. This is initially set when you call the DragDrop.DoDragDrop method: DragDrop.DoDragDrop(dragSource, data, DragDropEffects); Here, the DragDropEffects property represents an enumeration of type DragDropEffects. If you set this to DragDropEffects.Copy | DragDropEffects.Move, then you should be able to move or copy (by holding down the Ctrl key): DragDrop.DoDragDrop(dragSource, data, DragDropEffects.Copy | DragDropEffects.Move); Now in one of the drag and drop handlers that receives a parameter of type DragEventArgs, you should see that the (DragEventArgs).AllowedEffects property will have the value that you set in the DragDrop.DoDragDrop

Categories : Wpf

Why does Alt Gr have the same keyCode as Ctrl?
The Problem is that the alert halts execution of the code, so the second onkeyup is not called. By changing the function to function KeyCheck(e) { var KeyID = (window.event) ? event.keyCode : e.keyCode; switch(KeyID) { case 18: document.Form1.KeyName.value = document.Form1.KeyName.value+"Alt"; break; case 17: document.Form1.KeyName.value = document.Form1.KeyName.value+"Ctrl"; break; } } we can see that both Alt and Ctrl get called. Tested with Firefox 22 and IE 9.

Categories : Javascript

How to catch Ctrl + Alt + RShftKey
There is no way to detect difference between Shifts using standard VB.NET approach. You will have to hook into Windows API for that: <System.Runtime.InteropServices.DllImport("user32.dll")> _ Private Shared Function GetAsyncKeyState(vKey As Keys) As Short End Function Private Sub Form2_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown If e.Control And e.Alt And e.Shift Then If Convert.ToBoolean(GetAsyncKeyState(Keys.LShiftKey)) Then MsgBox("CTRL + ALT + LEFT SHIFT") ElseIf Convert.ToBoolean(GetAsyncKeyState(Keys.RShiftKey)) Then MsgBox("CTRL + ALT + RIGHT SHIFT") End If End If End Sub

Categories : Vb.Net

Replicating the Ctrl+F behaviour
Why not do something like: $(".summary-block").each(function () { $(this).html(function (index, oldHTML) { return oldHTML.replace( search_param, "<span style='color:green;'>" + search_param + "</span>"); }); }); JS Fiddle This is ALOT less code and it only looks at the text of the element, not the Html. Edit: As per comments, I have updated this to work with more than one .summary-block element. EDIT: As per your new edit. Please see the above fiddle. Basically, you create a RegExp object and specify a pattern to replace instead. var pattern = new RegExp(search_param, 'gi'); //.. replace(pattern, "<span style='color:green;'>" + search_param +"</span>") ..// See this post for more information: Case Insensitive javascript replace regex

Categories : Jquery

how to Simulate Ctrl+ c in Delphi
(Let me preface this by saying that using the clipboard for inter-process communication is a bad idea. The clipboard belongs to the user, and your application should only use it as a result of the user choosing to do so.) If you have text selected in Notepad, this will get the contents into a TMemo on a Delphi form (uses just a TMemo and TButton; add ClipBrd to your uses clause): procedure TForm1.Button1Click(Sender: TObject); var NpWnd, NpEdit: HWnd; begin Memo1.Clear; NpWnd := FindWindow('Notepad', nil); if NpWnd <> 0 then begin NpEdit := FindWindowEx(NpWnd, 0, 'Edit', nil); if NpEdit <> 0 then begin SendMessage(NpEdit, WM_COPY, 0, 0); Memo1.Lines.Text := Clipboard.AsText; end; end; end; Sample of results: If the text is not sele

Categories : Delphi

Handle CTRL+C on Win32
The following code works for me: #include <windows.h> #include <stdio.h> BOOL WINAPI consoleHandler(DWORD signal) { if (signal == CTRL_C_EVENT) printf("Ctrl-C handled "); // do cleanup return TRUE; } int main() { running = TRUE; if (!SetConsoleCtrlHandler(consoleHandler, TRUE)) { printf(" ERROR: Could not set control handler"); return 1; } while (1) { /* do work */ } return 0; }

Categories : C++

Upload screenshots by ctrl+v
In Trello, they use an event handler registered on the paste event and basically accessing event.clipboardData.items. The javascript code (here) is minified, hence not particularly easy to read, but it basically boils down to applying the trick found in that other question Extract of the paste handler: c.prototype.paste = function (b) { var c, f, e, g, h, k, m, l; e = null; h = this.handlers; for (g in h) if (c = h[g], null != c.paste) { e = c.paste; break } if (null != e && (f = null != (k = null != (m = b.originalEvent) ? null != (l = m.clipboardData) ? l.items : void 0 : void 0) ? k : [], b = function (b) { return _.detect

Categories : Javascript

Tmux is blocking Ctrl-s in OSX ML
It probably has to do with flow control: historically (and still today, in some terminals), Ctrl-S pauses the output, and Ctrl-Q resumes it. iTerm2 ignores Ctrl-S, as it assumes that it has no use for flow control in the world where 300 and 2400 baud modems are not all that common. I am not sure, but I think stty -ixon might help. (I'm tentatively answering since it's been 5 hours, but I might be way off on the solution, even though I think the cause is correct).

Categories : Osx

Ctrl-p can't find my file?
https://github.com/kien/ctrlp.vim/issues/234 It looks that set poperty: let g:ctrlp_max_files=0 solved my problem. I worked at on one Android phone Manufacturers. However the project contains about 600'000 more files. ReScan cost a lot of time

Categories : Vim

send a CTRL-C over a network
Telnet really does send 0x03. Telnet is just a regular TCP connection with some escape codes that do various things. But to test a server over telnet, you probably really want to use the "Expect" utility: http://en.wikipedia.org/wiki/Expect

Categories : C++

Why pressing Ctrl+M is not working?
What you're doing doesn't make sense: e.KeyCode is an enum value, which can only hold one value at a time, an enum value cannot be both Keys.M and Keys.RControl at the same time(1). Windows handles Control (and other special keys) as modifiers, the correct way is like so: if(e.KeyCode == Keys.M && e.Control) { or if(e.Keycode == Keys.M && (e.Modifiers & Keys.RControl) == Keys.RControl) { (1)(not counting Flags, and I know Keys is marked as Flags, but i'm trying to keep things simple)

Categories : C#

Capturing the ctrl+V in VB.NET combobox
Use the keydown event and alter the clipboard like this Private Sub ComboBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyDown If e.KeyCode = Keys.V AndAlso (e.Modifiers And Keys.Control) <> 0 Then My.Computer.Clipboard.SetText(My.Computer.Clipboard.GetText().Replace(vbCrLf, " ")) End If End Sub But this example is going to alter the clipboard contents. Modify it to paste or insert yourself as you wish

Categories : Vb.Net

How to send a Ctrl-Z in Perl
The nn notation treats the numeric arguments as octal digits, so you are really sending chr(22) (Ctrl+V?) $ perl -e 'print ord("26")' 22 Character 26 can be expressed in all of these ways (and probably a few others) chr(26) "32" "x1a" "cZ"

Categories : Perl

Can't map Ctrl + minus in Emacs in Mac OS X
With these type of problems I usually try f1 k and right after the key combination that I'm having a problem with, C-- in your case. One of two things should happen: Nothing happens - this means that the shortcut is being intercepted at the level of the operating system. It gives you a description of a function that's being called. It's probable that it was set by either your major mode or one of the minor modes. So you should investigate that as well, searching though the references to this function, which is text-scale-decrease in you case. After you find either global-set-key, or local-set-key or define-key with this function, either comment it out, or better just call the same function with same shortcut and nil in your ~/.emacs. UPD: how to unset a key When you find that some so

Categories : Emacs

Getting CTRL characters with NCurses
That actually is reliable (but with 64, not 96). Ctrl-A all the way through Ctrl-_ are handled properly (use of Ctrl-@ is discouraged due to other meanings of NUL).

Categories : C

Best way to prevent Ctrl+c on JTextArea
Not tested, but I would simply override copy() and cut(): @Override public void copy() { // does nothing } @Override public void cut() { // does nothing } Looking at the source code, it should work, since that's what JPasswordField does to prevent cutting/copying.

Categories : Java

Is it possible to modify ctrl-o behaviour in VIM?
You can use :normal! to call the original implementation, like this: function s:CtrlO(count1) let buf=bufnr('%') execute 'normal!' a:count1 "<C-o>" if bufnr('%')!=buf execute 'bwipeout' buf endif endfunction nnoremap <silent> <C-o> :<C-u>call <SID>CtrlO(v:count1)<CR>

Categories : Vim

Selenium CTRL and click not working?
I have managed to solve this with the following code: Robot robot = new Robot(); selectConsentRow.click(); robot.keyPress(KeyEvent.VK_CONTROL); secondRow.click(); robot.keyRelease(KeyEvent.VK_CONTROL);

Categories : Java

Run when when you ctrl + click a button in a WinForm?
Not well versed in VB, but you tagged this as C# as well, should be trivial for you to switch over. private void Form1_MouseClick(object sender, MouseEventArgs e) { if (Control.ModifierKeys == Keys.Control) { Console.WriteLine("Ctrl+Click"); } }

Categories : Vb.Net

Empty a TMemo with Ctrl+Enter
The best way to handle this is as follows: Create an action list, or action manager, or re-use an existing one. Add an action that clears the memo and moves to the next one. You'll need to check that the active control really is a memo. Give the action the shortcut that you desire, CTRL+ENTER. Note that you don't need to attach the action to anything. It's mere presence is enough to ensure that the shortcut will be handled. For compound keyboard actions using modifier keys it's always simplest to use an action shortcut and so keep at arm's length from the lower level keyboard handling code. Your action handler might look like this: if ActiveControl is TMemo then begin Memo := TMemo(ActiveControl); Text := Memo.Text; Memo.Clear; SelectNext(Memo, True, True); if ActiveCont

Categories : Delphi

DataGridview, disable Ctrl+Click
I am not sure about what you mean with a special functionality when Ctrl+Clicking on a cell. But if what you want is a code being triggered when a cell is clicked and Ctrl is pressed, you can rely on the CellMouseClick event: Private Sub DataGridView1_CellMouseClick(sender As Object, e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseClick If (Control.ModifierKeys = Keys.Control) Then MessageBox.Show("CTRL & Click") End If End Sub

Categories : Vb.Net

Is it possible to configure Eclipse to do ctrl+space always like sts 3.3.0 does
In the Eclipse preferences, go to Java > Editor > Content Assist. In the Auto Activation group, in the the Auto Activation triggers for Java add all the letters and space after the dot. You can also reduce the activation delay. I have set mine to 50ms for instance. I think it should give you most of what you expect. Note that I have never used STS.

Categories : Eclipse

Keyboard shortcut ctrl+r not working for me
Based on some quick testing at http://api.jquery.com/event.which/, it seems you want event.which == 82, not event.which == 9. Although most browsers tend to use Ctrl + R to refresh the page, so this might not be the best way to handle whatever you're doing.

Categories : Javascript

MVC ListBoxFor multiselection without ctrl button
I've used Bootstrap Multiselect before, with great success. If it cannot be a drop down, use this Checkbox list instead.

Categories : Asp Net Mvc

What do Ctrl+number keys do in a terminal?
There's not a real definite answer. It's all based on the operating system you're using. For example, I'm using Ubuntu 12.04 on one computer, and its key bindings are different than what I have another system with an older version that I keep as a server.

Categories : Linux

How to press Ctrl+V in selenium webdriver
Here's what I would suggest: IWebDriver webDriver = new InternetExplorerDriver(); webDriver.Navigate().GoToUrl(@"C:UsersusDocumentsVisual Studio 2012ProjectsSeleniumTestsSeleniumTests est.html"); var el = webDriver.FindElement(By.XPath(".//*[@id='fld']")); el.Click(); el.SendKeys(Keys.Control + "v"); webDriver.Quit();

Categories : Selenium

How to alias 'clear' to CTRL+L keystroke
clear clears the screen simply by outputting some ANSI escapes sequences. You can do the same thing with printf: alias clear='printf "e[He[2J"'

Categories : Misc

Ace Editor - Change CTRL+H keybinding
Replace command is defined here. it is possible to use the following code to change CTRL+H for CTRL+R editor.commands.addCommand({ name: "replace", bindKey: {win: "Ctrl-R", mac: "Command-Option-F"}, exec: function(editor) { require("ace/config").loadModule("ace/ext/searchbox", function(e) { e.Search(editor, true) // take care of keybinding inside searchbox // this is too hacky :( var kb = editor.searchBox.$searchBarKb command = kb.commands["Ctrl-f|Command-f|Ctrl-H|Command-Option-F"] if (command.bindKey.indexOf("Ctrl-R") == -1) { command.bindKey += "|Ctrl-R" kb.addCommand(command) } }); } }); but the part

Categories : Misc

Python CTRL+C to exit interpreter?
You could change the signal handler for Ctrl-C to something that exits the interpreter: import signal import sys signal.signal(signal.SIGINT, lambda number, frame: sys.exit()) You could probably put that code in a file to be run automatically when an interactive session starts, then set the environment variable PYTHONSTARTUP to the name of that file: http://docs.python.org/3/using/cmdline.html?highlight=startup#envvar-PYTHONSTARTUP

Categories : Python

How can I simulate "CTRL +S" keypress in Javascript
Use the saveDocument() method. Docs for it here. Edit: That only works in Firefox.

Categories : Javascript

Use Ctrl+/ as shortcut in Delphi program
If you assign an OnShortCut event handler to your menu's parent TForm, you will see that pressing Ctrl+/ results in a TShortCut value of 16575 from Menus.ShortCutFromMessage(), which is the function that the VCL uses internally when dispatching keystrokes for shortcut handling. Both ShortCutToText(16495) and ShortCutToText(16575) return 'Ctrl+/', so lets break it down: scCtrl = $4000 16495 = $406F 16575 = $40BF Both shortcuts have the scCtrl flag present. ShortCutToText($6F) and ShortCutToText($BF) both return '/'. This is because MapVirtualKey() returns the same scan code ($350000) for both virtual keys $6F (VK_DIVIDE) and $BF (VK_OEM_2 - the /? key for US keyboards). When dispatching a shortcut, the VCL does exact comparisons of TShortCut values. So when you have 16495 assigned as

Categories : Delphi

How to stop the tornado web server with ctrl+c?
You can stop Tornado main loop with tornado.ioloop.IOLoop.instance().stop(). To have this method called after passing signal with Crtl+C you can periodically check global flag to test if main loop should end and register handler for SIGINT signal which will change value of this flag: #!/usr/bin/python # -*- coding: utf-8 -*- import tornado.ioloop import tornado.web import signal import logging from tornado.options import options is_closing = False def signal_handler(signum, frame): global is_closing logging.info('exiting...') is_closing = True def try_exit(): global is_closing if is_closing: # clean up here tornado.ioloop.IOLoop.instance().stop() logging.info('exit success') class MainHandler(tornado.web.RequestHandler): def get(self):

Categories : Python



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