<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>shortcuts JavaScript API Module</title><link>https://community.telligent.com/community/13/w/api-documentation/75727/shortcuts-javascript-api-module</link><description>&lt;p&gt;&lt;span&gt;Developing on Verint Community? Use the API documentation as a reference for all supported interactions with Verint Community.&lt;/span&gt;&lt;/p&gt;</description><dc:language>en-US</dc:language><generator>14.0.0.586 14</generator><item><title>shortcuts JavaScript API Module</title><link>https://community.telligent.com/community/13/w/api-documentation/75727/shortcuts-javascript-api-module</link><pubDate>Fri, 08 Mar 2024 17:51:10 GMT</pubDate><guid isPermaLink="false">ecf7ef87-4357-400e-acab-1bc52ae9ca81</guid><dc:creator>Ben Tiedt</dc:creator><comments>https://community.telligent.com/community/13/w/api-documentation/75727/shortcuts-javascript-api-module#comments</comments><description>Current Revision posted to API Documentation by Ben Tiedt on 03/08/2024 17:51:10&lt;br /&gt;
&lt;hr class="generated-documentation-start" style="border-width:0;" /&gt;&lt;h3&gt;jQuery.telligent.evolution.shortcuts&lt;/h3&gt;
&lt;p&gt;This module provides a simple way to register keyboard shortcuts. Shortcuts can be defined with simple key combinations and can be assigned managed by their handle as well as optional namespaces. Shortcuts can also be scoped to target specific focused elements. Combined with the Keyboard Shortcuts widget, currently registered and available shortcuts can be displayed.&lt;/p&gt;
&lt;h3&gt;Methods&lt;/h3&gt;
&lt;h4&gt;register&lt;/h4&gt;
&lt;p&gt;Registers a keyboard shortcut and returns a registration handle.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;var handleId = $.telligent.evolution.shortcuts.register(shortcut, function(data) {
    // handle the shortcut
}, options);
&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;shortcut&lt;/code&gt;: Keyboard combination string or array of strings to handle. Can be a simple string such as &lt;code&gt;&amp;#39;j&amp;#39;&lt;/code&gt; or any combination of case-insensitive modifiers such as &lt;code&gt;&amp;#39;ctrl + shift + j&amp;#39;&lt;/code&gt;. Modifiers include &lt;code&gt;alt&lt;/code&gt;, &lt;code&gt;meta&lt;/code&gt;, &lt;code&gt;ctrl&lt;/code&gt;, &lt;code&gt;shift&lt;/code&gt;, &lt;code&gt;cmd&lt;/code&gt;, and &lt;code&gt;opt&lt;/code&gt;. Additionally, direction arrows and special keys can also be used, such as &lt;code&gt;&amp;#39;ctrl + up&amp;#39;&lt;/code&gt;, &lt;code&gt;&amp;#39;shift + esc&amp;#39;&lt;/code&gt;, or simply &lt;code&gt;&amp;#39;ret&amp;#39;&lt;/code&gt;. If passed an array, maps each shortcut to the same handler.&lt;/li&gt;
&lt;li&gt;If the handler function returns false, it prevents further bubbling of the key event.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Options is optional and can include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;description&lt;/code&gt;: optional description. When provided, the shortcut will be included by the Keyboard Shortcut widget when listing available shortcuts at any given time.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;scope&lt;/code&gt;: optional DOM element, jQuery selection, or selector. When provided, shortcut will only trigger if the focused element is contained within the scope.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;namespace&lt;/code&gt;: optional namespace string or array of namespace strings to allow clearing one or many multiple registered keyboard shortcuts later without having the registeration handle&lt;/li&gt;
&lt;li&gt;&lt;code&gt;direction&lt;/code&gt;: Whether to trigger on &amp;#39;down&amp;#39; or &amp;#39;up&amp;#39;. Default: direction.down.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;unregister&lt;/h4&gt;
&lt;p&gt;Unregisters a keyboard shortcut or multiple shortcuts by handle id or namespace.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Unregister by registration handle ID
$.telligent.evolution.shortcuts.unregister(handleId);
// Unregister by namespace
$.telligent.evolution.shortcuts.unregister(&amp;#39;myNameSpace&amp;#39;);
// Unregister all
$.telligent.evolution.shortcuts.unregister();
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;list&lt;/h4&gt;
&lt;p&gt;Lists currently registered shortcuts&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$.telligent.evolution.shortcuts.list(options);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Options is optional and can include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;scoped&lt;/code&gt;: When true, only includes shortcuts which would be effectively triggerable based on the current focused element.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;captureFocus&lt;/h4&gt;
&lt;p&gt;Stores the current focused element, useful for returning focus later&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$.telligent.evolution.shortcuts.captureFocus();
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;refocus&lt;/h4&gt;
&lt;p&gt;Attempts to refocus on the last remembered focused element, including form inputs and rich text editors.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$.telligent.evolution.shortcuts.captureFocus();
&lt;/code&gt;&lt;/pre&gt;

&lt;hr class="generated-documentation-end" style="border-width:0;" /&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item></channel></rss>