disable the window function in jsf/primefaces - jsf

<p:commandButton id="cmdCancel" value="#{label.cancel}" action="cancel"/>
<p:hotkey bind="Alt+C" action="cancel" />
Hi ,
I have one button cancel and i binded it to short cut key "Alt+C" (refer above code) in prime faces.
And when i use press short cut key "Alt+C", it perform the cancel action and
but it also open the browser favorites menu on pressing the "Alt+C".
How can i stop this opening browser operation?Please suggest me any solution,.......

I guess that you simply can not override some of the browser's hardwired default hotkeys.
Think of pressing Alt+F4 to close the browser window etc.
Even the normal HTML hotkey attribute is not guaranteed to work if the browser already does something else when pressing the hotkey combination.
My answer is thus; Do not rely on hotkeys in a website to work at all.

Related

Enabling keyboard shortcuts to confirm Dialogs in AppleScript

I am looking for a way to allow a user to complete a Dialog entry using keyboard shortcuts. Is this possible?
Other questions have discussed assigning shortcuts to the options in an AppleScript dialog box, but not to the "Continue"/"Okay" etc. button.
The main difficulty is that I'm using a multi-line text entry form, so the Enter button simply creates a new line, instead of targeting the default button as it would conventionally. I'm hoping cmdenter can be assigned to the default button instead.
The line of script defining the dialog in question is:
set theResponse to display dialog "Enter tasks:" default answer "
" buttons {"Cancel", "Continue"} default button "Continue"
Running your AppleScript code from Script Editor on a US English MacBook Pro, whether or not something is typed in, fnenter presses the Continue button.
The same keyboard shortcut works on an US English Apple Magic Keyboard when connected to the MacBook Pro and I'd assume any US English Mac it was connected to would do the same. I only have the MacBook Pro to test with at the moment.
In macOS, by default, pressing the tab key in this use case will not move between the controls as the controlling setting in System Preferences > Keyboard > Shortcuts is not set to allow it to act on all controls.
You must select one of the following options, depending on the version of macOS one is running, in order to use the tab key on all controls.
If you see:
Full Keyboard Access: In windows and dialogs, press Tab to move keyboard focus between:
(•) Text boxed and lists only
( ) All Controls
Select: (•) All Controls
If you see:
[] Use keyboard navigation to move between controls
Press the Tab key to move focus forward and Shift Tab to move focus backward.
Check: [√] Use keyboard navigation to move between controls
With this done, one can then use tabtabenter to press the continue button, with the dialog box produced by the code shown in the OP.
Side Note: One can also try fncommandenter as that was necessary from within a VMware macOS Catalina virtual machine that I also tested in.
⌘-Enter (on the numeric keypad) presses Continue
If you are in a multiline text field, hit the Tab key so that focus is on some element other than the text field. Then the Enter key should route properly to the dialog's default close button.

What browser event does a screen reader use when pressing a button or link?

I've yet to setup a screen reader to test myself, but I'm wondering what specific browser event does a screen reader use when clicking a button or a link?
Is it the equivalent of a mouse click or tabbing to the element and pressing enter or space?
Screenreaders will trigger the click() event, but screenreader users may still use their keyboard, mouse, trackpad or braille display.
See SCR35: Making actions keyboard accessible by using the onclick event of anchors and buttons
While "onclick" sounds like it is tied to the mouse, the onclick event is actually mapped to the default action of a link or button. The default action occurs when the user clicks the element with a mouse, but it also occurs when the user focuses the element and hits enter or space, and when the element is triggered via the accessibility API.

Android Studio Documentation is always showing

enter image description here
When I press ctrl+q, the documentation is always shown.
I want the documentation to be auto hidden
How can I do this? Thank You
Keep pressing ctr + q to cycle between different views for the documentation window. You'll get the one you want eventually.
Ctrl-Q toggles between doc window states (when using the default keymap).
Possible states:
-Hidden
-Shown to the side of the auto-complete list
-Docked as one of the tabs
If you have a different keymap, you can search for this action in Settings -> Keymap. The action is called "Quick Doc".
Once the auto-completion window is open, you can cycle through the states of the documentation window by pressing Ctrl+Q. The last doc window state will be remembered for next time the auto-completion window opens.

Undo (ctrl +z ) is not working for text area when I use jquery autocomplete in IE

Jquery autocomplete breaks the undo in IE, In case of textarea what may be the reason ?
Try this,
Open this link in IE
http://jqueryui.com/demos/autocomplete/#multiple
Type any text in input element, for example type 'a' select 'ActionScript' from menu
now do backpsace to remove characters.
Now do undo ctrl + z , It's not working why ?
can any one explain ?
Thanks in advance
I had a similar problem:
Html text input undo not working
In the end I found out that if any JavaScript updated any visual elements, all the text boxes on the page had their undo history reset. In my case it was a timer updating a countdown clock, which made it very difficult to trace and debug. I imagine it is the autocomplete JQuery causing the problem here. The difference to mine is that it is updating the actual textbox, not an external element, but I suspect it is the same issue. I'm pretty sure it's a bug in IE so there's not a lot you can do about it, short of adding your own history functionality to the text box.
This is a problem specific to Internet Explorer - I suggest you try your page with Chrome or Firefox.

Disable a commandButton from receiving the "Enter" key

In the form I am creating, I have lots of buttons that depending on the data state, are disabled or enabled.
I have an issue where, in certain situations, my "Reset Form" button is the only enabled button left on the screen, so it accepts the "enter" keypress... and blows away all the user information.
I need to retain usage of the enter key with the other fields, but I'd like to hide this reset button from ever being seen on the page DOM as the "firstnext" button to invoke on enter keypress.
I've seen a few solutions w/ javascript, but I was hoping there was a native JSF way to do this, or even with an extension library. Taborder was of no help... Best I could come up with that works is a hidden button on the page dom in front of the reset button that dev/null's. There's gotta be some sort of cleaner solution.
Thanks in advance.
Turns out, if you declare a button as type="reset" it prevents firstnext recognition. You can still have an action="#{bean.resetFields}" method being called and it will give you the best of both worlds.

Resources