Hotkey Hotkey is used to bind a key or a key combination to an client side or server side event via ajax. In first example use "left" and "right" keys to switch images and in second example you can do an ajax request with the (ctrl+shift+s) combination.

ImageSwitch Integration (Left-Right)

Ajax Hotkey (ctrl + shift + s)

<h3 style="margin-top:0">ImageSwitch Integration (Left-Right)</h3>
<p:imageSwitch effect="fade" widgetVar="switcher" slideshowAuto="false">
    <p:graphicImage name="demo/images/nature/nature1.jpg" />
    <p:graphicImage name="demo/images/nature/nature2.jpg" />
    <p:graphicImage name="demo/images/nature/nature3.jpg" />
    <p:graphicImage name="demo/images/nature/nature4.jpg" />
</p:imageSwitch>

<p:hotkey bind="left" handler="PF('switcher').previous();" />
<p:hotkey bind="right" handler="PF('switcher').next();" />

<h3>Ajax Hotkey (ctrl + shift + s)</h3>
<h:form>
    <p:growl id="msgs" showDetail="true" />

    <p:hotkey bind="ctrl+shift+s" update="msgs" actionListener="#{hotkeyView.save}"/>

    <h:panelGrid columns="2" cellpadding="5">
        <p:outputLabel for="text" value="Text" />
        <p:inputText id="text" value="#{hotkeyView.text}" />
    </h:panelGrid>
</h:form>
                
PrimeTek, Copyright © 2017
All rights reserved.
Running PrimeFaces-6.2-SNAPSHOT on Mojarra-2.3.2.