<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/395" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2013-07-17T17:33:46+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/395</id>

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2013-07-17T17:33:46+02:00</updated>

		<published>2013-07-17T17:33:46+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=395&amp;p=25593#p25593</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=395&amp;p=25593#p25593"/>
		<title type="html"><![CDATA[Re: hid-keys key repetition....]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=395&amp;p=25593#p25593"><![CDATA[
I define a new variable in main, lastSendKey.<br /><div class="codebox"><p>Code: </p><pre><code>int   main(void)<br />{<br />   uchar   key, keyDidChange = 0, lastKey = 0, lastSendKey = 0;<br /></code></pre></div><br />Then I change a little bit in the usbSetInterrupt part<br /><div class="codebox"><p>Code: </p><pre><code>if(keyDidChange &amp;&amp; usbInterruptIsReady() &amp;&amp; lastSendKey != lastKey){ //added: check so we dont send same key again :)<br />         keyDidChange = 0;<br />         /* use last key and not current key status in order to avoid lost<br />         changes in key status. */<br />         buildReport(lastKey);<br />         usbSetInterrupt(reportBuffer, sizeof(reportBuffer));<br />         lastSendKey = lastKey; // save last sended key to avoid repetions<br />      }<br />      else if (usbInterruptIsReady()) { // Usb interrupt Is ready but we haven't change key. Send no key (0)<br />         buildReport(0);<br />         usbSetInterrupt(reportBuffer, sizeof(reportBuffer));<br />      }<br /></code></pre></div><br /><br />Maybee not the best way. But it works for me <img class="smilies" src="./../../../images/smilies/icon_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by Guest — Wed Jul 17, 2013 5:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2007-04-11T15:12:28+02:00</updated>

		<published>2007-04-11T15:12:28+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=395&amp;p=1185#p1185</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=395&amp;p=1185#p1185"/>
		<title type="html"><![CDATA[hid-keys key repetition....]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=395&amp;p=1185#p1185"><![CDATA[
The HID spec suggests that key repitition can be implemented by sending the keyboard status in an interrupt transfer in regular intervals.<br /><br />Most operating system interpret the key status as status, measure the time how long a particular key is pressed and start repeating (with their own internal timer) after that time.<br /><br />On the other hand, if an operating system wants to out-source the task of key repitition to the device, it configures an idle rate. HIDKeys does not implement properly, although it accepts the idle rate setting.<br /><br />Search main.c for &quot;USBRQ_HID_SET_IDLE&quot; and &quot;idleCounter&quot; for details. The USB HID specification contains more information about the proper handling of USBRQ_HID_SET_IDLE.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Wed Apr 11, 2007 3:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2007-04-10T21:37:14+02:00</updated>

		<published>2007-04-10T21:37:14+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=395&amp;p=1182#p1182</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=395&amp;p=1182#p1182"/>
		<title type="html"><![CDATA[hid-keys key repetition....]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=395&amp;p=1182#p1182"><![CDATA[
Hello I'm building a keyboard emulator using avr-hid and the hid keys demo...<br /><br />i can't find any way to stop the computer from repeating a key...<br />i just want to be able to fire only one character until I release and press again. they computer seems to be repeating the code all the time...<br /><br />this is my main event loop stripped to the core...<br /><br />wdt_reset();<br />usbPoll();<br />        key = PINC &amp; 0x01;    <br /><br />if (( key == 1) &amp;&amp; (lastKey == 0) ) { <br />   while (!usbInterruptIsReady()) ;<br />           buildReport(1);   <br />           usbSetInterrupt(reportBuffer, sizeof(reportBuffer));  <br /><br />        }  <br /> lastKey = key;   <br /><br /><br />as anybody got any idea?<br /><br />massimo<p>Statistics: Posted by Guest — Tue Apr 10, 2007 9:37 pm</p><hr />
]]></content>
	</entry>
	</feed>
