<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/PT-BR/unbindKey?action=history&amp;feed=atom</id>
	<title>PT-BR/unbindKey - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/PT-BR/unbindKey?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/unbindKey&amp;action=history"/>
	<updated>2026-05-01T21:06:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PT-BR/unbindKey&amp;diff=68130&amp;oldid=prev</id>
		<title>Lettify: Created page with &quot;__NOTOC__ {{BR/Funcao_compartilhada}} Remove uma vinculação de tecla existente de um específico jogador. {{BR/Nota|unbindKey funcionará somente em binds que foram definida...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PT-BR/unbindKey&amp;diff=68130&amp;oldid=prev"/>
		<updated>2020-12-30T05:49:58Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ {{BR/Funcao_compartilhada}} Remove uma vinculação de tecla existente de um específico jogador. {{BR/Nota|unbindKey funcionará somente em binds que foram definida...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
{{BR/Funcao_compartilhada}}&lt;br /&gt;
Remove uma vinculação de tecla existente de um específico jogador.&lt;br /&gt;
{{BR/Nota|unbindKey funcionará somente em binds que foram definidas pelo mesmo resource}}&lt;br /&gt;
{{BR/Nota|unbindKey no servidor pode retornar ''true'' em casos de falhas}}&lt;br /&gt;
==Sintaxe== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Lado servidor&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool unbindKey ( player thePlayer, string key, string keyState, string command )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool unbindKey ( player thePlayer, string key [, string keyState, function handler ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Argumentos Necessários=== &lt;br /&gt;
*'''thePlayer:''' O jogador que você quer desvincular a tecla.&lt;br /&gt;
*'''key:''' A tecla que você quer desvincular. Veja a [[PT-BR/Key_names|lista de teclas]] para ter uma base de desenvolvimento.&lt;br /&gt;
*'''keyState:''' Pode ser qualquer um dos valores abaixo:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' Se a tecla vinculada acionou uma função quando a tecla foi liberada&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' Se a tecla vinculada acionou uma função quando a tecla foi pressionada&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' Se a tecla vinculada acionou uma função quando a tecla foi pressionada e liberada&lt;br /&gt;
*'''command :''' (1° Sintaxe) O comando que queira desvincular a tecla.&lt;br /&gt;
&lt;br /&gt;
===Argumentos Opcionais===&lt;br /&gt;
*'''keyState:''' Estado de pressionamento da tecla que foi vinculada para desvinculá-la. Opcional na 2° sintaxe.&lt;br /&gt;
*'''handler:''' (2° sintaxe) Função que você quer desvincular a tecla.&lt;br /&gt;
Nota: Se você não especificar a função ''handler'', qualquer instância da tecla ''key'' que está vinculada, será desvinculada, seja lá qual for a função que a tecla está vinculada.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna '''true'' se a tecla foi desvinculada, ''false'' se a tecla não foi previamente vinculada ou argumentos inválidos foram especificados na função.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Lado cliente&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool unbindKey ( string key, string keyState, string command )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool unbindKey ( string key [, string keyState, function handler ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Argumentos Necessários=== &lt;br /&gt;
*'''key:''' A tecla que você quer desvincular. Veja a [[PT-BR/Key_names|lista de teclas]] para ter uma base de desenvolvimento.&lt;br /&gt;
*'''keyState:''' Pode ser qualquer um dos valores abaixo:&lt;br /&gt;
**'''&amp;quot;up&amp;quot;:''' Se a tecla vinculada acionou uma função quando a tecla foi liberada&lt;br /&gt;
**'''&amp;quot;down&amp;quot;:''' Se a tecla vinculada acionou uma função quando a tecla foi pressionada&lt;br /&gt;
**'''&amp;quot;both&amp;quot;:''' Se a tecla vinculada acionou uma função quando a tecla foi pressionada e liberada&lt;br /&gt;
*'''command :''' (1° Sintaxe) O comando que queira desvincular a tecla.&lt;br /&gt;
&lt;br /&gt;
===Argumentos Opcionais===&lt;br /&gt;
*'''keyState:''' Estado de pressionamento da tecla que foi vinculada para desvinculá-la. Opcional na 2° sintaxe.&lt;br /&gt;
*'''handler:''' (2° sintaxe) Função que você quer desvincular a tecla.&lt;br /&gt;
Nota: Se você não especificar a função ''handler'', qualquer instância da tecla ''key'' que está vinculada, será desvinculada, seja lá qual for a função que a tecla está vinculada.&lt;br /&gt;
&lt;br /&gt;
===Retorno===&lt;br /&gt;
Retorna '''true'' se a tecla foi desvinculada, ''false'' se a tecla não foi previamente vinculada ou argumentos inválidos foram especificados na função.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Exemplo==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Lado servidor&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
Esta função vincula a tecla ''F1'' do jogador à função ''goMoo'' que exibe uma mensagem no chat quando pressionada. A tecla é então desvinculada para que possa s&lt;br /&gt;
er usada efetivamente uma vez por vida.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define the function that will be called when F1 is pressed&lt;br /&gt;
function goMoo( player )&lt;br /&gt;
    outputChatBox ( getPlayerName ( player ) .. &amp;quot; says Mooooooo!&amp;quot; )&lt;br /&gt;
    unbindKey ( player, &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, goMoo )   -- this function will no longer be triggered by the player, after removing the bind.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function playerSpawn ( )&lt;br /&gt;
    bindKey ( source, &amp;quot;F1&amp;quot;, &amp;quot;down&amp;quot;, goMoo ) -- bind the player's F1 key to the 'goMoo' function defined above&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerSpawn&amp;quot;, root, playerSpawn ) -- make the playerSpawn function be called when a player spawns&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Veja também==&lt;br /&gt;
{{Input functions}}&lt;/div&gt;</summary>
		<author><name>Lettify</name></author>
	</entry>
</feed>