logo
On this page

Does Super Board SDK support hotkey operations?

2021-09-09
Products / Plugins:Super Board
Platform / Framework:All

Problem Description

Does Super Board SDK support using hotkeys to create, delete graphics, scroll, flip whiteboard pages, and other operations?

Solution

Yes. Developers can listen to hotkeys at the business layer and call the corresponding Super Board SDK interfaces in the respective callbacks to perform the corresponding operations.

For example, if a Web platform developer wants to implement deleting the currently selected graphic when the Delete key is pressed, you can refer to the following code:

// Listen to keydown event
window.addEventListener('keydown', function (event) {
   const e = event || window.event || arguments.callee.caller.arguments[0];
   if (!e) return;
   switch (e.keyCode) {
       case 46: // Listen to Delete key, batch delete selected graphics
           // Call the whiteboard batch delete selected graphics interface
           ZegoSuperBoardManager.getInstance().getSuperBoardView().getCurrentSuperBoardSubView(). clearSelected();
           break;
       default:
           break;
   }
});

Previous

How to handle the prompt "Building for iOS Simulator..." when running the App?

Next

How to set Superboard logs?

On this page

Back to top