Moved build pressed keys function to KeyboardUtil class.
This commit is contained in:
parent
5a86a04adf
commit
cb6b798fea
@ -33,19 +33,22 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
import flash.events.Event;
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
|
||||
import flash.events.Event;
|
||||
|
||||
import mx.managers.HistoryManager;
|
||||
import mx.managers.IDragManager;
|
||||
import mx.managers.ToolTipManager;
|
||||
import mx.utils.URLUtil;
|
||||
import mx.utils.URLUtil;
|
||||
|
||||
import org.as3commons.logging.api.ILogger;
|
||||
import org.as3commons.logging.api.getClassLogger;
|
||||
import org.bigbluebutton.core.BBB;
|
||||
import org.bigbluebutton.core.KeyboardUtil;
|
||||
import org.bigbluebutton.main.api.ExternalApiCallbacks;
|
||||
import org.bigbluebutton.main.events.ShortcutEvent;
|
||||
import org.bigbluebutton.main.model.ShortcutOptions;
|
||||
import org.bigbluebutton.util.QueryStringParameters;
|
||||
import org.bigbluebutton.util.i18n.ResourceUtil;
|
||||
|
||||
private static const LOGGER:ILogger = getClassLogger(BigBlueButtonMainContainer);
|
||||
@ -199,7 +202,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
private function handleKeyDown(e:KeyboardEvent) :void {
|
||||
if (keyCombos == null) loadKeyCombos(globalModifier);
|
||||
|
||||
var keyPress:String = (e.ctrlKey ? "control+" : "") + (e.shiftKey ? "shift+" : "") + (e.altKey ? "alt+" : "") + e.keyCode;
|
||||
var keyPress:String = KeyboardUtil.buildPressedKeys(e);
|
||||
|
||||
if (e.keyCode < 64 || e.keyCode > 90){
|
||||
LOGGER.debug("Keypress debugging: KeyCode {0} is nonalphabetic (probably)", [e.keyCode]);
|
||||
|
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
|
||||
*
|
||||
* Copyright (c) 2017 BigBlueButton Inc. and by respective authors (see below).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 3.0 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package org.bigbluebutton.core {
|
||||
import flash.events.KeyboardEvent;
|
||||
|
||||
public final class KeyboardUtil {
|
||||
public static function buildPressedKeys(e:KeyboardEvent):String {
|
||||
return (e.ctrlKey ? "control+" : "") + (e.shiftKey ? "shift+" : "") + (e.altKey ? "alt+" : "") + e.keyCode;
|
||||
}
|
||||
}
|
||||
}
|
@ -79,6 +79,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
import org.as3commons.lang.StringUtils;
|
||||
import org.as3commons.logging.api.ILogger;
|
||||
import org.as3commons.logging.api.getClassLogger;
|
||||
import org.bigbluebutton.core.KeyboardUtil;
|
||||
import org.bigbluebutton.core.TimerUtil;
|
||||
import org.bigbluebutton.core.UsersUtil;
|
||||
import org.bigbluebutton.core.events.LockControlEvent;
|
||||
@ -106,25 +107,25 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
private static const LOGGER:ILogger = getClassLogger(ChatBox);
|
||||
|
||||
public var publicChat:Boolean = false;
|
||||
public var chatWithUserID:String;
|
||||
public var chatWithUsername:String
|
||||
public var publicChat:Boolean = false;
|
||||
public var chatWithUserID:String;
|
||||
public var chatWithUsername:String
|
||||
|
||||
public var read:Boolean = true;
|
||||
public var userHasLeft:Boolean = false;
|
||||
|
||||
private var globalDispatcher:Dispatcher = new Dispatcher();
|
||||
[Bindable] public var colorPickerColours:Array = ['0x000000', '0x7A7A7A' ,'0xFF0000', '0xFF8800',
|
||||
'0x88FF00', '0x00FF00', '0x00FF88', '0x00FFFF', '0x0088FF', '0x0000FF', '0x8800FF', '0xFF00FF'];
|
||||
[Bindable] public var colorPickerColours:Array = ['0x000000', '0x7A7A7A' ,'0xFF0000', '0xFF8800',
|
||||
'0x88FF00', '0x00FF00', '0x00FF88', '0x00FFFF', '0x0088FF', '0x0000FF', '0x8800FF', '0xFF00FF'];
|
||||
|
||||
[Bindable]
|
||||
private var backgroundColor:uint = 0x000000;
|
||||
private var lastSenderId:String = "";
|
||||
private var lastTime:String = "";
|
||||
|
||||
[Bindable]
|
||||
private var chatMessages:ChatConversation = new ChatConversation();
|
||||
|
||||
[Bindable]
|
||||
private var chatMessages:ChatConversation = new ChatConversation();
|
||||
|
||||
private var lastCount:Number = 0;
|
||||
private var scrollTimer:Timer;
|
||||
private var currentMessage:int;
|
||||
@ -145,8 +146,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
private var indicatorNeeded:Boolean = false
|
||||
private var repeat:Boolean = false;
|
||||
|
||||
[Bindable]
|
||||
private var chatListHeight:Number = 100;
|
||||
[Bindable]
|
||||
private var chatListHeight:Number = 100;
|
||||
|
||||
[Bindable] public var chatOptions:ChatOptions = new ChatOptions();
|
||||
|
||||
@ -446,7 +447,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
var modifier:String = ExternalInterface.call("determineModifier");
|
||||
loadKeyCombos(modifier);
|
||||
|
||||
var keyPress:String = (e.ctrlKey ? "control+" : "") + (e.shiftKey ? "shift+" : "") + (e.altKey ? "alt+" : "") + e.keyCode;
|
||||
var keyPress:String = KeyboardUtil.buildPressedKeys(e);
|
||||
|
||||
if (keyCombos[keyPress]) {
|
||||
LOGGER.debug("WATERFALL: Caught shortcut in chat box, {0}", [keyCombos[keyPress]]);
|
||||
|
@ -43,6 +43,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import org.bigbluebutton.common.IBbbModuleWindow;
|
||||
import org.bigbluebutton.common.events.LocaleChangeEvent;
|
||||
import org.bigbluebutton.core.KeyboardUtil;
|
||||
import org.bigbluebutton.main.events.ShortcutEvent;
|
||||
import org.bigbluebutton.modules.chat.model.ChatOptions;
|
||||
import org.bigbluebutton.util.i18n.ResourceUtil;
|
||||
@ -97,8 +98,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
private function handleKeyDown(e:KeyboardEvent) :void {
|
||||
var modifier:String = ExternalInterface.call("determineModifier");
|
||||
loadKeyCombos(modifier);
|
||||
var keyPress:String = (e.ctrlKey ? "control+" : "") + (e.shiftKey ? "shift+" : "") +
|
||||
(e.altKey ? "alt+" : "") + e.keyCode;
|
||||
var keyPress:String = KeyboardUtil.buildPressedKeys(e);
|
||||
if (keyCombos[keyPress]) {
|
||||
disp.dispatchEvent(new ShortcutEvent(keyCombos[keyPress]));
|
||||
}
|
||||
|
@ -71,7 +71,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import mx.controls.Menu;
|
||||
import mx.events.MenuEvent;
|
||||
import mx.events.ResizeEvent;
|
||||
import mx.managers.PopUpManager;
|
||||
|
||||
import flexlib.mdi.events.MDIWindowEvent;
|
||||
@ -81,6 +80,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
import org.bigbluebutton.common.IBbbModuleWindow;
|
||||
import org.bigbluebutton.common.events.LocaleChangeEvent;
|
||||
import org.bigbluebutton.core.BBB;
|
||||
import org.bigbluebutton.core.KeyboardUtil;
|
||||
import org.bigbluebutton.core.UsersUtil;
|
||||
import org.bigbluebutton.main.events.MadePresenterEvent;
|
||||
import org.bigbluebutton.main.events.ShortcutEvent;
|
||||
@ -107,11 +107,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
private static const LOGGER:ILogger = getClassLogger(PresentationWindow);
|
||||
|
||||
public static const TITLE:String = "Presentation";
|
||||
public static const TITLE:String = "Presentation";
|
||||
private static const GOTO_PAGE_BUTTON:String = "Go to Page...";
|
||||
|
||||
[Bindable]
|
||||
private var thumbY:Number;
|
||||
private var thumbY:Number;
|
||||
public var uploadWindow:FileUploadWindow = null;
|
||||
private var pageDialog:GotoPageDialog;
|
||||
|
||||
@ -225,7 +225,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
var modifier:String = ExternalInterface.call("determineModifier");
|
||||
loadKeyCombos(modifier);
|
||||
|
||||
var keyPress:String = (e.ctrlKey ? "control+" : "") + (e.shiftKey ? "shift+" : "") + (e.altKey ? "alt+" : "") + e.keyCode;
|
||||
var keyPress:String = KeyboardUtil.buildPressedKeys(e);
|
||||
|
||||
if (keyCombos[keyPress]) {
|
||||
//globalDispatcher.dispatchEvent(new ShortcutEvent(keyCombos[keyPress]));
|
||||
|
@ -63,6 +63,7 @@
|
||||
import org.bigbluebutton.common.IBbbModuleWindow;
|
||||
import org.bigbluebutton.common.Images;
|
||||
import org.bigbluebutton.common.events.LocaleChangeEvent;
|
||||
import org.bigbluebutton.core.KeyboardUtil;
|
||||
import org.bigbluebutton.core.TimerUtil;
|
||||
import org.bigbluebutton.core.UsersUtil;
|
||||
import org.bigbluebutton.core.events.LockControlEvent;
|
||||
@ -492,8 +493,7 @@
|
||||
// Handle general-access hotkeys, regardless of what window the user is focused in
|
||||
private function handleKeyDown(e:KeyboardEvent):void {
|
||||
if (keyCombos == null) loadKeyCombos(modifier);
|
||||
var keyPress:String = (e.ctrlKey ? "control+" : "") + (e.shiftKey ? "shift+" : "") +
|
||||
(e.altKey ? "alt+" : "") + e.keyCode;
|
||||
var keyPress:String = KeyboardUtil.buildPressedKeys(e);
|
||||
if (keyCombos[keyPress]) {
|
||||
switch (keyCombos[keyPress]) {
|
||||
case FOCUS_USERS_LIST:
|
||||
|
@ -40,6 +40,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import mx.core.UIComponent;
|
||||
|
||||
import org.bigbluebutton.core.KeyboardUtil;
|
||||
import org.bigbluebutton.main.events.ShortcutEvent;
|
||||
import org.bigbluebutton.main.views.MainCanvas;
|
||||
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
|
||||
@ -73,8 +74,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
private function handleKeyDown(e:KeyboardEvent) :void {
|
||||
var modifier:String = ExternalInterface.call("determineModifier");
|
||||
loadKeyCombos(modifier);
|
||||
var keyPress:String = (e.ctrlKey ? "control+" : "") + (e.shiftKey ? "shift+" : "") +
|
||||
(e.altKey ? "alt+" : "") + e.keyCode;
|
||||
var keyPress:String = KeyboardUtil.buildPressedKeys(e);
|
||||
if (keyCombos[keyPress]) {
|
||||
disp.dispatchEvent(new ShortcutEvent(keyCombos[keyPress]));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user