Unity KeyCode for mute button for Fire TV remote - unity3d

I have this problem when I'm looking at the amazon developer page for unity: https://developer.amazon.com/docs/fire-tv/controller-input-with-unity.html#controller-names
it shows the keycodes for all the buttons, except for the mute button on the remote.
My model is different; there's a volume button and a mute button. Neither of these are documented.
Thanks for your time!

Not a direct answer but you could maybe try to simply print it out using something like
public class Debug : MonoBehaviour
{
// Just print to a text so you can easily see the result on the screen
public Text text;
private void OnGUI()
{
var e = Event.current;
if (e.keyCode != KeyCode.None)
{
text.text = e.keyCode.ToString();
}
}
}
this way you could see which keycode responds to which pressed button/key etc.

According to the Fire TV Guidelines, volume +/- and mute are not to be mapped.
I heard that it's possible, but you will get rejected from the amazon appstore.
Source: https://developer.amazon.com/docs/fire-tv/remote-input.html
If you use the new input system, I released an asset on the assetstore which gives you access to all mappable buttons (Dpad, Select, Back, Menu, Rewind, Play/Pause, FastForward)
I'm not posting any links, but it's easy to find if you search for "Fire TV" on the asset store.

Related

Samsung Smart Tv Return Button

I created the app for the samsung smart tv. I tested my app using the Remote test system. All the functionalities are working properly except the return key. When i press the return button it is returning to the home screen but i want my app to return to the previous screen of my app. This is working correctly while i test this in the emulator.
I checked this by giving alers in the return key functionality. It is alerting that after it is returning to the homw screen.
Can anyone help me in this
RETURN and EXIT key are followed by default behavior to closing application and going back to smart hub or tv broadcast screen.
You should implement prevent default behavior, please look at this page: http://samsungdforum.com/Guide/ref00009/sfkey_preventdefault.html
In Samsung Smart TV, RETURN default action is return to Home, as you can see in SDK documentation:
http://www.samsungdforum.com/Guide/
You must to include this line in your code:
sf.key.preventDefault();
Before your code to customize RETURN button action.
For example (case from a Switch):
case tvKey.RETURN :
sf.key.preventDefault();
window.history.go(-1);
break;
I was facing the same problem for a basic Javascript project. I resolved it by adding event.preventDefault();, for example:
Main.keyDown = function()
{
var keyCode = event.keyCode;
case tvKey.KEY_RETURN:
case tvKey.KEY_PANEL_RETURN: event.preventDefault();
}
For Apps Framework you can use this function:
sf.key.preventDefault();

GWT - Fullscreen

Is there a way to start a gwt-app in fullscreen mode (without toolbar, navigation)?
I found only a hint to open a new window:
Window.open("SOMEURL","SOMETITLE",
"fullscreen=yes,hotkeys=no,scrollbars=no,location=no,menubar=no,status=no,
toolbar=no,resizable=no");
Is this the only way?
If yes, what's the best way to use the "Window.open" (Example)?
This works for me:
private native void requestFullscreen() /*-{
var element = $doc.documentElement;
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
}
}-*/;
This isn't really a GWT question - this is a browser-provided API that GWT happens to wrap for you.
It's worth noting that modern browsers have a tendency to ignore some or all of these flags. For example, good luck getting Chrome to hide its address bar. The reason for this is that if they honoured all of the flags, you could write a web app which looked exactly like a desktop app and the user wouldn't know it - which is exactly what you sound like you're trying to do!
or use https://github.com/wokier/gwt-fullscreen
Caffeinate response has been used as a basis. I also added an event to be notified of fullscreen state change.

How to punt on making a view accessible via VoiceOver?

I'm working on making my iOS app accessible to vision impaired users. On one screen of my app I'm showing an image of sheet music, with a toolbar button which toggles the view to just show the lyrics. Eventually I would like to provide a braille version of the sheet music to visually impaired users, but for now I'm only providing an accessible version of the lyrics.
Until I can take the time to provide a good accessible version of the sheet music, what would be a professional, appropriate way to say via VoiceOver, "Sheet music; tap the lyrics button for VoiceOver content"? How would you word it, and would it be the label, the value, the hint, or something else?
very cool idea, and kudos on making your apps accessible!
Have you looked through the headers in UIKit to see what is available for the accessibility API? this probably the best place to start, as well as the accessibility programming guide on developer.apple.com
You can make VoiceOver speak by posting notifications:
UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, #"tap lyrics button to toggle...");
However, in this case it could be better to implement the accessibility API on the specific objects in question. For example, on the UI button that toggles your sheet music, you could do something like:
- (BOOL)isAccessibilityElement
{
return YES;
}
- (UIAccessibilityTraits)accessibilityTraits
{
return [super accessibilityTraits] | UIAccessibilityTraitButton;
}
- (NSString *)accessibilityLabel
{
return #"Toggle sheet music";
}
- (NSString *)accessibilityHint
{
return #"Double tap to toggle sheet music";
}

Titanium: Youtube video

How can I show a youtube or bits on the run video full screen on my app? Is there a special link I have to naviate to? Or is there a special API that takes care of that to view it fullscreen?
The idea is to click on a link 'show video', then show the video fullscreen, and get a button play pauze and 'done'. When clicked done it goes back to the previous page.
I don't know how to get started on this one. Can anyone help me out?
I'm creating an iPhone app.
Thanks!
#Muhammad has the first part right but to get it to close when you hit the blue done button you'll need the following code.
replace
win.add(activeMovie);
activeMovie.play();
with
win.add(activeMovie);
activeMovie.fullscreen = 1; // this must be defined after you add to the window!
activeMovie.play();
then add this
activeMovie.addEventListener('fullscreen', function(e) {
if(!e.entering) { // this is run only when exiting fullscreen aka the blue done button
activeMovie.stop();
}
});
Here is a an example code to show video with controlls
var win = Titanium.UI.currentWindow;
var contentURL = 'http://movies.apple.com/media/us/ipad/2010/tours/apple-ipad-video-us-20100127_r848-9cie.mov';
var activeMovie = Titanium.Media.createVideoPlayer({
contentURL: contentURL,
backgroundColor:'#111',
movieControlMode:Titanium.Media.VIDEO_CONTROL_DEFAULT,
scalingMode:Titanium.Media.VIDEO_SCALING_MODE_FILL
});
win.add(activeMovie);
activeMovie.play();
Hope this will help.

display soft keyboard (iPad) when is connected a bluetooth input device

I'm really bangin' my head because I can't find the way to show the soft keyboard when there's a bluetooth input device connected to the iPad. I made some search on the web and this is the result:
a question on stackoverflow with a very short answer How can I detect if an external keyboard is present on an iPad?
an application developed by erica sadun for the cydia env http://www.tuaw.com/2010/06/02/hacksugar-bringing-back-the-on-screen-keyboard/
Erica said that the trick is to answer to the system that "There's no hardware keyboard attached".
I tried to write a category for UIKeyboardImpl and I overrided:
- (BOOL)isInHardwareKeyboardMode {
DEBUG(#"is called");
return NO;
}
But until now I haven't obtained anything. The overrided method is called but there's no soft keyboard.
Erica also said the application works by dynamic linking but I don't know how can I accomplish it. I don't need to be in the AppStore because this is a private application so I don't bother about rejection.
Thanks in advance
Ok. Finally got it. Many thanks to David, Matthias and Enrico. Here are the steps:
import the private framework GraphicsServices
call GSEventSetHardwareKeyboardAttached(NO) inside the viewDidLoad
add a button that toggles the keyboard by calling
static void toggleKeyboard(UIKeyboardImpl * keyImpl){
if (UIKeyboardAutomaticIsOnScreen()) {
UIKeyboardOrderOutAutomatic();
} else {
UIKeyboardOrderInAutomatic();
}
I've found this function on http://code.google.com/p/btstack/wiki/iPhoneKeyboardHiding
Now I can take input from the soft keyboard and from the bluetooth device at the same time.
To get around it using the apple keyboard you hit the eject key. Perhaps you can implement an action that sends the eject keycode? I think iSSH has a feature where you can tap the onscreen keyboard icon to bring it up even when a bluetooth keyboard is connected.