How to leave the keyboard available to the user in the Viber bot? - viber-bot

Telegram has in class telegram.ReplyKeyboardMarkup parameter one_time_keyboard (bool, optional) – Requests clients to hide the keyboard as soon as it’s been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to False.
But Viber always hides keyboards. How to make the keyboard available to the user?
Now I have one idea to draw a keyboard along with each message.

Related

How to implement only emoji keyboard for Entry?

I would like to implement Custom Entry (Xamarin.forms) when the user focus the Entry, device will show Emoji keyboard.
Short answer
Unfortunately it is impossible without creating your own keyboard, due to Android and iOS platform limitations.
Long answer
Default behaviour on iOS is to show the emoji keyboard icon in the bottom of the keyboard. So it is only one tap away from the user:
Default behaviour on Android is seems to be slightly different and the emoji keyboard is hidden by default:
Luckily, it is very easy to place the emoji keyboard icon by setting the InputType to Android.Text.InputTypes.TextVariationShortMessage | Android.Text.InputTypes.ClassText:
If you are still looking to show the emoji keyboard by default, I am afraid you will have to implement your own keyboard view. Depend on your needs you could add few emojis as buttons and etc.
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/text/entry#customizing-the-keyboard
Customizing the Keyboard
The keyboard that's presented when users interact with an Entry can be set programmatically via the Keyboard property, to one of the following properties from the Keyboard class:
Chat – used for texting and places where emoji are useful.
Default – the default keyboard.
Email – used when entering email addresses.
Numeric – used when entering numbers.
Plain – used when entering text, without any KeyboardFlags specified.
Telephone – used when entering telephone numbers.
Text – used when entering text.
Url – used for entering file paths & web addresses.
This can be accomplished in XAML as follows:
<Entry Keyboard="Chat" />
The equivalent C# code is:
var entry = new Entry { Keyboard = Keyboard.Chat };

forward inline keyboard along message in telegram

I want to create a message with telegram api that users could share(forward) it along its inline keyboard buttons.
I know with telegram api you can create a message that contains inline keyboard by adding inline_keyboard array in replay_markup of a message but when I forward this message inside telegram just the text part of the message forwards and buttons wont.
In brief I want to know is it possible to create a message with telegram api that when someone forwards this message inline keyboard of that message forwards too.
InlineKeyboardButton with "url" or "login_url" parameter can be forwarded.
Note: if there is another button in keyboard without "url" or "login_url" parameter whole keyboard woudn't be shown
You can't attach inline keyboard in the forwarded message, but you can add a “Share” button, and use switch_inline_query in inline keyboard.
For instance: Users can use #Sean_Bot TeleBot to send a photo with inline buttons, if they want to keep inline buttons, they should click “Share” button instead of directly forward.

Telegram inline keyboard and keyboard

I have question about Telegram bot.
I want keyboard and inline keyboard, Can I enable both of the features at the same time ?
According to Telegram documentation, it's currently impossible to pass two or more objects for reply_markup at the same time. reply_markup only accepts one of these objects at the same time:
InlineKeyboardMarkup
ReplyKeyboardMarkup
ReplyKeyboardRemove
ForceReply
And of course you cannot combine two or more objects together. If you wanna show keyboard and have inline keyboard too, you can show the keyboard in a message and after that send another message with inline keyboard.
Cheers,

Using JAWS to get key events

I need to capture the current time each time a spacebar is pressed on the browser while using JAWS Screen reader. I am able to capture the spacebar if I am not using JAWS, however, the system cannot capture any spacebar once JAWS is on.
Here is my code:
$(document).keypress(function(event) {
var chCode = ('charCode' in event) ? event.charCode : event.keyCode;
if (chCode == 32){ //32 is keyCode for spacebar
addTime = addTime + Number(new Date()) + ",";
var x = document.getElementById("spacebar");
alert("spacebars!!!");
}
});
I would like to know what to do so that I can capture the current time each time a spacebar is pressed.
Funny enough, each time a spacebar is pressed, JAWS reads out "space" but the event is not captured at the code level.
OR - Since JAWS reads out "Space" when I press the spacebar, does anyone know how I can capture JAWS event? Since it recognizes it when I press spacebar, I am wondering if I can capture the event directly from JAWS. Any thoughts?
This happens because most screen readers, and namely JAWS, provide so-called virtual cursor in browsers. This is needed for quick navigation on web pages and alike documents.
To test this, try pressing a letter on a web page while JAWS is on. For instance, if you press b, JAWS will say "No buttons" because b moves to the next button (if any). To type text, you need to enter the forms mode.
The spacebar, on the other side, works only when you are on a clickable element (link, button, check box or just an element with onClick event attached), then it activates the element; or in forms mode, then it types the space into an edit field.
In order to accomplish what you want to do, you need to declare a part of your web page as role="application" (more on this here):
When the user navigates an element assigned the role of application, assistive technologies that typically intercept standard keyboard events SHOULD switch to an application browsing mode, and pass keyboard events through to the web application.
The intent is to hint to certain assistive technologies to switch from normal browsing mode into a mode more appropriate for interacting with a web application; some user agents have a browse navigation mode where keys, such as up and down arrows, are used to browse the document, and this native behavior prevents the use of these keys by a web application.
So, in order to be able to count your time, just declare a parent div as role="application", and your Spacebar will be passed directly to the application and not intercepted by JAWS.

Facebook Log In with virtual QWERTY in FLEX

I am working in a project which uses the Facebook graph-api to log in. I have the requirement of only using a virtual keyboard (no hardware will be present). I have looked everywhere, but can't find a solution for adding a virtual qwerty keyboard to the popUp.
I can put the keyboard into a popup, or I could add the qwerty keyboard into the screen with the addChild() method, but I still have one problem: the virtual keyboard does not focus to the textInputs of the popup and when i press a key, everything "explooota".
Anyone knows how i could solve the focus problem?
I mean... when i prees the virtual key, i call a java function wich simulate a physical keyboard, but i lose the focus into the facebook input text and the letter is not in the textinput... and i dont know how to recover the focus...
Thanks in advance for the help!
We had the same problem with a desktop app written in C#. I can only answer for a windows based application. Assuming you are working on a desktop app and that you are showing the login in a web browser control you can use the SendInput API to direct keyboard-like input to a field in the browser. We had our own custom keyboard; I don't think you will be able to use the built-in on-screen keyboard MS provides.
We had a windows form that hosted a web browser control and the keyboard custom control. The user touches the field that they want to fill in. The user types their input using the on-screen keyboard, the keyboard uses SendInput to send the appropriate character for the key that was touched to the web browser control. Other problems to look out for:
the facebook login form takes a lot of space, having both the keyboard and login visible at the same time is difficult
sending non-ascii characters; see this for help (SendInput sequence to create unicode character fails)
the user will have to touch to select the input field
there are other links on the FB login page you may want to restrict (like create an account)
an on-screen keyboard where touching the key doesn't steal focus from the browser field
These can all be solved but they are not trivial.

Resources