Source language: Translate to:

Se puede asignar una tecla a un boton? en aplicacion web

General questions about NeoAppBuilder - our rapid application development tool for building HTML5, web and mobile apps.

Moderator: Neosoft Support

Se puede asignar una tecla a un boton? en aplicacion web

Postby gusgusl » Sat Oct 01, 2016 8:27 am

Necesito en una aplicación que corre en la web que contiene un botón que el usuario pueda hacer click en ese botón sin necesidad de hacerlo con el raton sino haciéndolo mediante el teclado asignándole una tecla, es posible?
gusgusl
 
Posts: 254
Joined: Fri Mar 12, 2010 12:44 pm

Re: Se puede asignar una tecla a un boton? en aplicacion web

Postby Neosoft Support » Sun Oct 02, 2016 2:59 pm

To trap a key press you could try adding something like this to your app's Start Up action (Project > Events):

Code: Select all
BeginJS
window.addEventListener("keydown", function(e){
  if (e.key = 77) {
    alert( 'You pressed the letter m.' );
  }
});
EndJS


This code displays an alert box when the letter 'm' is pressed.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Se puede asignar una tecla a un boton? en aplicacion web

Postby gusgusl » Wed Oct 05, 2016 4:52 pm

En la version final de "Neoapp" se podra hacer esto de manera mas facil desde el cuadro de propiedades?
como se hace en "Neobook"?

Mi pregunta se traslada a otros comandos que son muy faciles de usar en "Neobook" como lo es "MessageBox" que en "Neoapp" se torna complicado su manejo ya que se debe llamar a una subrutina para poder leer la opcion elegida por el usuario

In the final version of "Neoapp" you may do this more easily from the properties box?
as is done in "Neobook"?

My question is transferred to other commands that are very easy to use "Neobook" as is "MessageBox" in "Neoapp" becomes complicated handling as it should call a subroutine to read the option chosen by the user
gusgusl
 
Posts: 254
Joined: Fri Mar 12, 2010 12:44 pm

Re: Se puede asignar una tecla a un boton? en aplicacion web

Postby Neosoft Support » Sat Oct 08, 2016 6:38 pm

In the final version of "Neoapp" you may do this more easily from the properties box?
as is done in "Neobook"?


Possibly. Unlike Windows apps there isn't a straightforward feature for assigning shortcut keys to buttons. HTML does have an accesskey attribute, but it's handled slightly differently by different browsers. It's also limited to specific key combinations. A description of accesskey below:

http://www.w3schools.com/tags/att_global_accesskey.asp

My question is transferred to other commands that are very easy to use "Neobook" as is "MessageBox" in "Neoapp" becomes complicated handling as it should call a subroutine to read the option chosen by the user


This is a limitation of JavaScript. See my answer here: http://www.neosoftware.com/community/viewtopic.php?f=38&t=21744
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to General NeoAppBuilder Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron