mirror of
https://github.com/openstf/stf
synced 2025-10-05 19:42:01 +02:00
Added back Advanced Input.
This commit is contained in:
parent
129a1d1f45
commit
b4db9fad03
4 changed files with 33 additions and 32 deletions
|
@ -64,12 +64,19 @@ module.exports = function ControlServiceFactory(
|
|||
|
||||
function keySender(type, fixedKey) {
|
||||
return function(key) {
|
||||
var mapped = fixedKey || keyCodes[key]
|
||||
if (mapped) {
|
||||
if (typeof key === 'string') {
|
||||
sendOneWay(type, {
|
||||
key: mapped
|
||||
key: key
|
||||
})
|
||||
}
|
||||
else {
|
||||
var mapped = fixedKey || keyCodes[key]
|
||||
if (mapped) {
|
||||
sendOneWay(type, {
|
||||
key: mapped
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.row
|
||||
//.col-md-12
|
||||
div(ng-include='"control-panes/advanced/run-js/run-js.jade"')
|
||||
//.col-md-6
|
||||
.col-md-6
|
||||
div(ng-include='"control-panes/advanced/input/input.jade"')
|
||||
.col-md-6
|
||||
div(ng-include='"control-panes/advanced/port-forwarding/port-forwarding.jade"')
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
module.exports = function InputCtrl($scope, KeycodesAndroid) {
|
||||
|
||||
$scope.press = function (key) {
|
||||
console.log(key)
|
||||
var mapped = KeycodesAndroid[key]
|
||||
if (mapped) {
|
||||
$scope.control.rawKeyPress(mapped)
|
||||
} else {
|
||||
console.error(key + ' is not mapped')
|
||||
}
|
||||
$scope.control.keyPress(key)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,37 +6,37 @@
|
|||
div
|
||||
h6(translate) Special Keys
|
||||
div.special-keys-buttons
|
||||
button(title='Power', ng-click='press("KEYCODE_POWER")').btn.btn-danger
|
||||
button(title='Power', ng-click='press("power")').btn.btn-danger
|
||||
i.fa.fa-power-off
|
||||
button(title='Camera', ng-click='press("KEYCODE_CAMERA")').btn.btn-primary
|
||||
button(title='Camera', ng-click='press("camera")').btn.btn-primary
|
||||
i.fa.fa-camera
|
||||
button(title='Switch Charset', ng-click='press("KEYCODE_SWITCH_CHARSET")').btn.btn-primary.btn-info
|
||||
button(title='Switch Charset', ng-click='press("switch_charset")').btn.btn-primary.btn-info
|
||||
i.fa Aa
|
||||
button(title='Search', ng-click='press("KEYCODE_SEARCH")').btn.btn-primary
|
||||
button(title='Search', ng-click='press("search")').btn.btn-primary
|
||||
i.fa.fa-search
|
||||
|
||||
h6(translate) Volume
|
||||
.btn-group
|
||||
button(title='Mute', ng-click='press("KEYCODE_MUTE")').btn.btn-primary.btn-xs
|
||||
button(title='Mute', ng-click='press("mute")').btn.btn-primary.btn-xs
|
||||
i.fa.fa-volume-off
|
||||
button(title='Volume Down', ng-click='press("KEYCODE_VOLUME_DOWN")').btn.btn-primary.btn-xs
|
||||
button(title='Volume Down', ng-click='press("volume_down")').btn.btn-primary.btn-xs
|
||||
i.fa.fa-volume-down
|
||||
button(title='Volume Up', ng-click='press("KEYCODE_VOLUME_UP")').btn.btn-primary.btn-xs
|
||||
button(title='Volume Up', ng-click='press("volume_up")').btn.btn-primary.btn-xs
|
||||
i.fa.fa-volume-up
|
||||
|
||||
h6(translate) Media
|
||||
.btn-group
|
||||
button(title='Rewind', ng-click='press("KEYCODE_MEDIA_REWIND")').btn.btn-primary.btn-xs
|
||||
button(title='Rewind', ng-click='press("media_rewind")').btn.btn-primary.btn-xs
|
||||
i.fa.fa-fast-backward
|
||||
button(title='Previous', ng-click='press("KEYCODE_MEDIA_PREVIOUS")').btn.btn-primary.btn-xs
|
||||
button(title='Previous', ng-click='press("media_previous")').btn.btn-primary.btn-xs
|
||||
i.fa.fa-step-backward
|
||||
button(title='Play/Pause', ng-click='press("KEYCODE_MEDIA_PLAY_PAUSE")').btn.btn-primary.btn-xs
|
||||
button(title='Play/Pause', ng-click='press("media_play_pause")').btn.btn-primary.btn-xs
|
||||
i.fa.fa-youtube-play
|
||||
button(title='Stop', ng-click='press("KEYCODE_MEDIA_STOP")').btn.btn-primary.btn-xs
|
||||
button(title='Stop', ng-click='press("media_stop")').btn.btn-primary.btn-xs
|
||||
i.fa.fa-stop
|
||||
button(title='Next', ng-click='press("KEYCODE_MEDIA_NEXT")').btn.btn-primary.btn-xs
|
||||
button(title='Next', ng-click='press("media_next")').btn.btn-primary.btn-xs
|
||||
i.fa.fa-step-forward
|
||||
button(title='Fast Forward', ng-click='press("KEYCODE_MEDIA_FAST_FORWARD")').btn.btn-primary.btn-xs
|
||||
button(title='Fast Forward', ng-click='press("media_fast_forward")').btn.btn-primary.btn-xs
|
||||
i.fa.fa-fast-forward
|
||||
//h6 Physical Media
|
||||
//.btn-group
|
||||
|
@ -50,8 +50,8 @@
|
|||
i.fa.fa-eject
|
||||
button(title='Record', ng-click='press("KEYCODE_MEDIA_RECORD")').btn.btn-primary.btn-xs
|
||||
i.fa.fa-circle
|
||||
h6(translate) Other Keys
|
||||
div.special-other-keys-buttons
|
||||
//h6(translate) Other Keys
|
||||
//div.special-other-keys-buttons
|
||||
button(ng-click='press("KEYCODE_APP_SWITCH")').btn.btn-default.btn-xs
|
||||
i.fa App Switch
|
||||
button(ng-click='press("KEYCODE_MANNER_MODE")').btn.btn-default.btn-xs
|
||||
|
@ -93,22 +93,22 @@
|
|||
tr
|
||||
td
|
||||
td
|
||||
button(title='D-pad Up', ng-click='press("KEYCODE_DPAD_UP")').btn.btn-info.btn-xs
|
||||
button(title='D-pad Up', ng-click='press("dpad_up")').btn.btn-info.btn-xs
|
||||
i.fa.fa-chevron-up
|
||||
td
|
||||
tr
|
||||
td
|
||||
button(title='D-pad Left', ng-click='press("KEYCODE_DPAD_LEFT")').btn.btn-info.btn-xs
|
||||
button(title='D-pad Left', ng-click='press("dpad_left")').btn.btn-info.btn-xs
|
||||
i.fa.fa-chevron-left
|
||||
td
|
||||
button(title='D-pad Center', ng-click='press("KEYCODE_DPAD_CENTER")').btn.btn-info.btn-xs
|
||||
button(title='D-pad Center', ng-click='press("dpad_center")').btn.btn-info.btn-xs
|
||||
i.fa.fa-circle-o
|
||||
td
|
||||
button(title='D-pad Right', ng-click='press("KEYCODE_DPAD_RIGHT")').btn.btn-info.btn-xs
|
||||
button(title='D-pad Right', ng-click='press("dpad_right")').btn.btn-info.btn-xs
|
||||
i.fa.fa-chevron-right
|
||||
tr
|
||||
td
|
||||
td
|
||||
button(title='D-pad Down', ng-click='press("KEYCODE_DPAD_DOWN")').btn.btn-info.btn-xs
|
||||
button(title='D-pad Down', ng-click='press("dpad_down")').btn.btn-info.btn-xs
|
||||
i.fa.fa-chevron-down
|
||||
td
|
||||
td
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue