Diferencia entre revisiones de «Manual de programación de OS/2/Llamadas KBDxxx para acceso al teclado»

Contenido eliminado Contenido añadido
Sin resumen de edición
 
m Bot: Correcciones ortográficas; cambios triviales
Línea 2:
</A>
<P>KbdCharIn devuelve una lectura del teclado, indicando que teclas aisladas est&aacute;n pulsadas.
<P>#define INCL_BASE<BRbr />#include &lt;os2.h&gt;
 
<P>PKBDKEYINFO CharData;
<BRbr />USHORT IOWait;
<BRbr />HKBD KbdHandle;
<BRbr />APIRET rc; /* Codigo de error */
<P>rc = KbdCharIn(CharData, IOWait, KbdHandle);
<P><TABLE><TH><H3>Par&aacute;metros</H3></TH>
Línea 27:
<TD>Estado del evento de pulsaci&oacute;n. Se lee por bits:
 
<BRbr />
<TABLE>
 
Línea 36:
<TR>
<TD>7-6</TD>
<TD>Indican si es el primer byte o el &uacute;ltimo de un caractercarácter multi byte (DBCS). Si es 10, es el primer byte; si es 01 es el &uacute;ltimo, y si es 11, es el &uacute;nico byte. Para recuperar c&oacute;digos multibyte es necesario ejecutar una llamada a <B>KbdCharIn</B> por cada byte.</TD>
 
</TR>
Línea 50:
<TR>
<TD>1</TD>
<TD>Si es 0, el ScanCode es un caractercarácter; si es 1, el ScanCode no es un caractercarácter, sino un codigo extendido.</TD>
</TR>
<TR>
Línea 66:
<TR>
<TD>fsState (USHORT)</TD>
<TD>Describe las teclas que hay pulsadas:<BRbr />
 
<TABLE>
Línea 155:
</TABLE>
</TD></TR>
<TR><TD>IOWait</TD><TD>Si es 0, el thread es dormido hasta que halla un caractercarácter disponible; si es 1, la llamada vuelve inmediatamente aunque no halla caracteres disponibles.</TD></TR>
<TR><TD>KbdHandle</TD><TD>Handle de teclado. Debe ser 0.</TD></TR>
 
Línea 166:
 
<TR><TD>447</TD><TD>El teclado est&aacute; ocupado</TD></TR>
<TR><TD>464</TD><TD>KBD inactivo (proceso en <I>''detached</I>'')</TD></TR>
<TR><TD>504</TD><TD>KBD Extended SG</TD></TR>
</TABLE>
Línea 174:
</A>
<P>KbdFlushBuffer vac&iacute;a el buffer de teclado.
<P>#define INCL_BASE<BRbr />#include &lt;os2.h&gt;
<P>HKBD KbdHandle;
<BRbr />APIRET rc; /* Codigo de error */
<P>rc = KbdFlushBuffer(KbdHandle);
<P><TABLE><TH><H3>Par&aacute;metros</H3></TH>
Línea 188:
<TR><TD>447</TD><TD>El teclado est&aacute; ocupado</TD></TR>
 
<TR><TD>464</TD><TD>KBD inactivo (proceso en <I>''detached</I>'')</TD></TR>
<TR><TD>504</TD><TD>KBD Extended SG</TD></TR>
</TABLE>
Línea 195:
</A>
<P>KbdGetStatus obtiene el estado actual del teclado.
<P>#define INCL_BASE<BRbr />#include &lt;os2.h&gt;
 
<P>PKBDINFO StatData;
<BRbr />HKBD KbdHandle;
<BRbr />APIRET rc; /* Codigo de error */
<P>rc = KbdGetStatus(StatData, KbdHandle);
<P><TABLE><TH><H3>Par&aacute;metros</H3></TH>
Línea 213:
<TD>fsMask (USHORT)</TD>
<TD>Estado del teclado:
<BRbr />
<TABLE>
 
Línea 271:
<TR>
<TD>chTurnAround (USHORT)</TD>
<TD>Caracter de retorno. En ASCII y ASCII extendido, el caractercarácter de retorno es el retorno de carro (13). En formato ASCII, el caractercarácter de retorno se indica en el byte menos significativo.</TD>
</TR>
<TR>
Línea 280:
<TR>
<TD>fsState (USHORT)</TD>
<TD>Describe las teclas que hay pulsadas:<BRbr />
 
<TABLE>
Línea 374:
<TR><TD>447</TD><TD>El teclado est&aacute; ocupado</TD></TR>
 
<TR><TD>464</TD><TD>KBD inactivo (proceso en <I>''detached</I>'')</TD></TR>
<TR><TD>504</TD><TD>KBD Extended SG</TD></TR>
</TABLE>
Línea 380:
<P><A NAME="KBDPEEK"><CENTER><H1><HR>KbdPeek<HR></H1></CENTER>
</A>
<P>KbdPeek devuelve cualquier dato disponible en el buffer de teclado de la misma forma que <B>'''KdbCharIn</B>''', pero sin borrarlo de &eacute;ste.
 
<P>#define INCL_BASE<BRbr />#include &lt;os2.h&gt;
<P>PKBDKEYINFO CharData;
<BRbr />HKBD KbdHandle;
<BRbr />APIRET rc; /* Codigo de error */
<P>rc = KbdPeek(CharData, KbdHandle);
<P><TABLE><TH><H3>Par&aacute;metros</H3></TH>
Línea 406:
<TD>Estado del evento de pulsaci&oacute;n. Se lee por bits:
 
<BRbr />
<TABLE>
 
Línea 415:
<TR>
<TD>7-6</TD>
<TD>Indican si es el primer byte o el &uacute;ltimo de un caractercarácter multi byte (DBCS). Si es 10, es el primer byte; si es 01 es el &uacute;ltimo, y si es 11, es el &uacute;nico byte. Para recuperar c&oacute;digos multibyte es necesario ejecutar una llamada a <B>KbdPeek</B> por cada byte.</TD>
 
</TR>
Línea 429:
<TR>
<TD>1</TD>
<TD>Si es 0, el ScanCode es un caractercarácter; si es 1, el ScanCode no es un caractercarácter, sino un codigo extendido.</TD>
</TR>
<TR>
Línea 445:
<TR>
<TD>fsState (USHORT)</TD>
<TD>Describe las teclas que hay pulsadas:<BRbr />
 
<TABLE>
Línea 543:
<TR><TD>447</TD><TD>El teclado est&aacute; ocupado</TD></TR>
 
<TR><TD>464</TD><TD>KBD inactivo (proceso en <I>''detached</I>'')</TD></TR>
<TR><TD>504</TD><TD>KBD Extended SG</TD></TR>
</TABLE>
Línea 549:
<P><A NAME="KBDSETSTATUS"><CENTER><H1><HR>KbdSetStatus<HR></H1></CENTER>
</A>
<P>KbdSetStatus establece las caractercarácter&iacute;sticas del teclado.
<P>#define INCL_BASE<BRbr />#include &lt;os2.h&gt;
 
<P>PKBDINFO StatData;
<BRbr />HKBD KbdHandle;
<BRbr />APIRET rc; /* Codigo de error */
<P>rc = KbdSetStatus(StatData, KbdHandle);
<P><TABLE><TH><H3>Par&aacute;metros</H3></TH>
Línea 568:
<TD>fsMask (USHORT)</TD>
<TD>El nuevo estado al que se pasa. Si los bits 0 y 1 est&aacute;n a 0, el estado del Echo no se cambia; si alguno se activa, se pasa a ese estado Echo. Si los bits 2 y 3 est&aacute;n a 0, el modo binario y el ASCII no se cambian; si alguno se activa, se pasa a ese estado. Si los bits 0 y 1 est&aacute;n activos, o si los bits 2 y 3 est&aacute;n a 1, se devuelve un error. Si el modo binario est&aacute; activo, el Echo se ignora.
<BRbr />
<TABLE>
<TR>
Línea 625:
<TR>
<TD>chTurnAround (USHORT)</TD>
<TD>Caracter de retorno. En ASCII y ASCII extendido, el caractercarácter de retorno es el retorno de carro (13). En formato ASCII, el caractercarácter de retorno se indica en el byte menos significativo.</TD>
</TR>
<TR>
Línea 634:
<TR>
<TD>fsState (USHORT)</TD>
<TD>Describe las teclas que hay pulsadas:<BRbr />
 
<TABLE>
Línea 730:
<TR><TD>445</TD><TD>Se requiere el foco del teclado</TD></TR>
<TR><TD>447</TD><TD>El teclado est&aacute; ocupado</TD></TR>
<TR><TD>464</TD><TD>KBD inactivo (proceso en <I>''detached</I>'')</TD></TR>
 
<TR><TD>504</TD><TD>KBD Extended SG</TD></TR>
Línea 738:
</A>
<P>KbdStringIn lee una cadena de caracteres desde el teclado. Estos pueden ser visualizados a la vez que se teclean si el modo Echo est&aacute; activo.
<P>#define INCL_BASE<BRbr />#include &lt;os2.h&gt;
<P>PCH CharBuffer;
<BRbr />PSTRINGINBUF StringLength;
 
<BRbr />USHORT IOWait;
<BRbr />HKBD KbdHandle;
<BRbr />APIRET rc; /* Codigo de error */
<P>rc = KbdStringIn(CharBuffer, StringLength, IOWait, KbdHandle);
<P><TABLE><TH><H3>Par&aacute;metros</H3></TH>
Línea 753:
<TABLE BORDER=1>
<TR>
<TD>cb<BRbr />USHORT)</TD>
<TD>Longitud del buffer en bytes. La longitud m&aacute;xima es 255.</TD>
</TR>
<TR>
<TD>cchIn<BRbr />(USHORT)</TD>
<TD>N&uacute;mero de bytes que OS/2 ha depositado en el buffer.</TD>
 
Línea 763:
</TABLE>
</TD></TR>
<TR><TD>IOWait</TD><TD>Si es 0, espera. En modo binario se espera hasta que se llena el buffer. En modo ASCII se espera hasta que se pulse el c&oacute;digo de retorno (por defecto, el retorno de carro).<BRbr />Si es 1, no espera. Retorna tanto si hay como si no hay caracteres disponibles. Si hay caracteres, devuelve todos ellos inmediatamente (siempre que no superen el m&aacute;ximo que cabe en el buffer). Esta opci&oacute;n no est&aacute; soportada en modo ASCII.</TD></TR>
<TR><TD>KbdHandle</TD><TD>Handle de teclado. Debe ser 0.</TD></TR>
</TABLE>
Línea 772:
<TR><TD>439</TD><TD>Handle no v&aacute;lido</TD></TR>
<TR><TD>445</TD><TD>Se requiere el foco del teclado</TD></TR>
<TR><TD>464</TD><TD>KBD inactivo (proceso en <I>''detached</I>'')</TD></TR>
 
<TR><TD>504</TD><TD>KBD Extended SG</TD></TR>