<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[getch function]]></title><description><![CDATA[<p>Ich hab da gerade ein problem mit der getch-function....<br />
ich habe hier die folgende while schleife:</p>
<pre><code class="language-cpp">while(fokus==1)
		{
			tastefokus = getch();
			if (tastefokus=='q') 
				{
				fokus=0;
				tastefokus=getch();
				}
			while (tastefokus=='r') 
				{
				QAPIExtWriteDO8(handle,block,kanaeler,1);
				tastefokus=getch();
				cout &lt;&lt;tastefokus&lt;&lt;'\n';
				}
			while (tastefokus=='l') 
				{
				QAPIExtWriteDO8(handle,block,kanaelel,1);
				tastefokus=getch();
				}

		QAPIExtWriteDO8(handle,block,kanaele0,1);
		}
</code></pre>
<p>wenn ich diese schleife nun laufen lasse möchte ich, dass die whilebedingungen tastefokus='r' bzw. tastefokus='l' nur dann erfüllt werden, wenn auch wirklich die entsprechende taste gedrueckt wird.<br />
momentan ist das so, dass ich die schleife starte, z.b. r druecke und so lange in der while schleife tastefokus='r' bin, bis ich eine andere taste druecke...</p>
<p>wie kann ich das realisieren?</p>
<p>ciao, ben</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/133766/getch-function</link><generator>RSS for Node</generator><lastBuildDate>Fri, 28 Aug 2026 06:02:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/133766.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Jan 2006 15:54:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 15:55:31 GMT]]></title><description><![CDATA[<p>Ich hab da gerade ein problem mit der getch-function....<br />
ich habe hier die folgende while schleife:</p>
<pre><code class="language-cpp">while(fokus==1)
		{
			tastefokus = getch();
			if (tastefokus=='q') 
				{
				fokus=0;
				tastefokus=getch();
				}
			while (tastefokus=='r') 
				{
				QAPIExtWriteDO8(handle,block,kanaeler,1);
				tastefokus=getch();
				cout &lt;&lt;tastefokus&lt;&lt;'\n';
				}
			while (tastefokus=='l') 
				{
				QAPIExtWriteDO8(handle,block,kanaelel,1);
				tastefokus=getch();
				}

		QAPIExtWriteDO8(handle,block,kanaele0,1);
		}
</code></pre>
<p>wenn ich diese schleife nun laufen lasse möchte ich, dass die whilebedingungen tastefokus='r' bzw. tastefokus='l' nur dann erfüllt werden, wenn auch wirklich die entsprechende taste gedrueckt wird.<br />
momentan ist das so, dass ich die schleife starte, z.b. r druecke und so lange in der while schleife tastefokus='r' bin, bis ich eine andere taste druecke...</p>
<p>wie kann ich das realisieren?</p>
<p>ciao, ben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971516</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971516</guid><dc:creator><![CDATA[macinstyle]]></dc:creator><pubDate>Fri, 20 Jan 2006 15:55:31 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 15:55:50 GMT]]></title><description><![CDATA[<p>danke;</p>
<pre><code class="language-cpp">while(fokus==1) 
{ 
  tastefokus = getch(); 
  if (tastefokus=='q') 
  { 
    fokus=0; 
    tastefokus=getch(); 
  } 
  while (tastefokus=='r') 
  { 
    QAPIExtWriteDO8(handle,block,kanaeler,1); 
    tastefokus=getch(); 
    cout &lt;&lt;tastefokus&lt;&lt;'\n'; 
  } 
  while (tastefokus=='l') 
  { 
    QAPIExtWriteDO8(handle,block,kanaelel,1); 
    tastefokus=getch(); 
  } 

QAPIExtWriteDO8(handle,block,kanaele0,1); 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/971517</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971517</guid><dc:creator><![CDATA[dern00b]]></dc:creator><pubDate>Fri, 20 Jan 2006 15:55:50 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 15:57:33 GMT]]></title><description><![CDATA[<p>macinstyle schrieb:</p>
<blockquote>
<p>Ich hab da gerade ein problem mit der getch-function....<br />
ich habe hier die folgende while schleife:</p>
<p>[cpp]<br />
while(fokus==1)<br />
{<br />
tastefokus = getch();<br />
if (tastefokus=='q')<br />
{<br />
fokus=0;<br />
tastefokus=getch();<br />
}<br />
while (tastefokus=='r')<br />
{<br />
QAPIExtWriteDO8(handle,block,kanaeler,1);<br />
tastefokus=getch();<br />
cout &lt;&lt;tastefokus&lt;&lt;'\n';<br />
<strong>break;</strong><br />
}<br />
while (tastefokus=='l')<br />
{<br />
QAPIExtWriteDO8(handle,block,kanaelel,1);<br />
tastefokus=getch();<br />
}</p>
<p>QAPIExtWriteDO8(handle,block,kanaele0,1);<br />
}<br />
[/cpp]<br />
wenn ich diese schleife nun laufen lasse möchte ich, dass die whilebedingungen tastefokus='r' bzw. tastefokus='l' nur dann erfüllt werden, wenn auch wirklich die entsprechende taste gedrueckt wird.<br />
momentan ist das so, dass ich die schleife starte, z.b. r druecke und so lange in der while schleife tastefokus='r' bin, bis ich eine andere taste druecke...</p>
<p>wie kann ich das realisieren?</p>
<p>ciao, ben</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/971520</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971520</guid><dc:creator><![CDATA[ischduersieeswirihrsie]]></dc:creator><pubDate>Fri, 20 Jan 2006 15:57:33 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:09:59 GMT]]></title><description><![CDATA[<p>das break; hat nichts gebracht.</p>
<p>trotzdem danke, noch jemand weitere ideen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971533</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971533</guid><dc:creator><![CDATA[macinstyle]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:09:59 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:12:10 GMT]]></title><description><![CDATA[<p>schick mir das mal</p>
<p><a href="mailto:king-fred@web.de" rel="nofollow">king-fred@web.de</a><br />
ich weiß jetzt echt ent was du willst- break; dürdte die lösung sein</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971535</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971535</guid><dc:creator><![CDATA[dern00b]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:12:10 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:12:46 GMT]]></title><description><![CDATA[<p>oda icq<br />
178801668</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971536</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971536</guid><dc:creator><![CDATA[dern00b]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:12:46 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:15:08 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>macinstyle schrieb:</p>
<blockquote>
<p>das break; hat nichts gebracht.</p>
</blockquote>
<p>was genau willst du denn erreichen? Weil mir ist der Sinn des Codes etwas unklar...</p>
<p>Mfg</p>
<p>GPC</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971539</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971539</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:15:08 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:15:43 GMT]]></title><description><![CDATA[<p>gpc - das gleiche problem habe ich auch zu verstehen was er will^^,.<br />
ich dachte schon cih wäre ein troll</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971541</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971541</guid><dc:creator><![CDATA[dern00b]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:15:43 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:19:47 GMT]]></title><description><![CDATA[<p>hier mal der gesamte quellcode:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;iostream.h&gt;
#include &lt;fstream.h&gt;
#include &lt;stdio.h&gt;
#include &lt;conio.h&gt;
#include &lt;stdlib.h&gt;
#include &quot;qlib.h&quot;

int sicherheit (int fahrtrichtung,int fahrtstrecke,int istpositiondek,int istpositionrek)
{
int sollpositiondek;
int sollpositionrek;
int dekmax;
int x;
x=1;
sollpositionrek=istpositionrek;
sollpositiondek=istpositiondek;

if (fahrtrichtung==1)
	{
	sollpositiondek=istpositiondek+fahrtstrecke;
	}

if (fahrtrichtung==4)
	{
	sollpositiondek=istpositiondek-fahrtstrecke;
	}

if (fahrtrichtung==3)
	{
	sollpositionrek=istpositionrek+fahrtstrecke;
	}

if (fahrtrichtung==2)
	{
	sollpositionrek=istpositionrek-fahrtstrecke;
	}

dekmax=sollpositionrek*sollpositionrek; //hier wird später eine Formel für die maximalen deklinationsausschlaege eingegeben
if (sollpositiondek&gt;=dekmax)
	{
	x=0;
	}
return x;
}

main()
{
int hauptauswahl;
int fahrtrichtung;
int fahrtstrecke;
int istpositiondek;
int istpositionrek;
int fokus=1;
int nResult;
int block;
int kanaele0;
int kanaeler;
int kanaelel;
char tastefokus;
istpositiondek=20;
istpositionrek=5;
tastefokus=0;
block=3;
kanaele0=0;
kanaeler=1;
kanaelel=4;
ULONG handle = QAPIExtOpenCard(PCITTL32,0);
if ( handle == 0 ) 
	{
	printf(&quot;Karte nicht gefunden!\r\n&quot;); 
	exit(0);
	}
nResult=QAPIExtSpecial(handle, JOB_PCITTL32_IOMODE0_7,0,0);
nResult=QAPIExtSpecial(handle, JOB_PCITTL32_IOMODE8_15,0,0);
nResult=QAPIExtSpecial(handle, JOB_PCITTL32_IOMODE16_23,1,0);
nResult=QAPIExtSpecial(handle, JOB_PCITTL32_IOMODE24_31,1,0);

cout &lt;&lt; &quot;Zum Fahren waehle 1. Zum Fokussieren waehle 2.&quot;&lt;&lt;'\n';
cin&gt;&gt;hauptauswahl;

if (hauptauswahl==1)
	{
	cout &lt;&lt; &quot;Bitte Fahrtrichtung eingeben: Nach oben 1. Nach links 2. Nach rechts 3. Nach unten 4.&quot;&lt;&lt;'\n';
	cin&gt;&gt;fahrtrichtung;
	cout &lt;&lt; &quot;Bitte Fahrtstrecke in Bogenminuten eingeben.&quot;&lt;&lt;'\n';
	cin&gt;&gt;fahrtstrecke;
	if (sicherheit(fahrtrichtung, fahrtstrecke, istpositiondek, istpositionrek)==0)
		{
		cout &lt;&lt; &quot;Ziel liegt ausserhalb der Teleskopreichweite.&quot; &lt;&lt;'\n';
		}

	}
if (hauptauswahl==2)
	{
	cout &lt;&lt; &quot;Zum Fokussieren bitte die r(echts)- bzw. l(inks)-Taste gedrueckt halten. Um Fokussiermodus zu beenden q druecken.&quot;&lt;&lt;'\n';
	QAPIExtWriteDO8(handle,block,kanaele0,1);
	while(fokus==1)
		{
			tastefokus = getch();
			if (tastefokus=='q') 
				{
				QAPIExtWriteDO8(handle,block,kanaele0,1);
				fokus=0;
				break;
				}
			while (tastefokus=='r') 
				{
				QAPIExtWriteDO8(handle,block,kanaeler,1);
				tastefokus=getch();
				break;
				}
			while (tastefokus=='l') 
				{
				QAPIExtWriteDO8(handle,block,kanaelel,1);
				tastefokus=getch();
				break;
				}

		QAPIExtWriteDO8(handle,block,kanaele0,1);
		}	
	}
}
</code></pre>
<p>der befehl QAPIExtWriteDO8(handle,block,kanaeler,1) legt eine spannung auf einen port einer pci-card.</p>
<p>der befehl QAPIExtWriteDO8(handle,block,kanaele0,1); setzt die spannung wieder auf 0.</p>
<p>ich möchte, dass die spannung nur so lange anliegt, so lange ich auch die taste r druecke.<br />
momentan ist es so, dass ich r druecke, die spannung dann anliegt, diese aber erst wieder weggeht, wenn ich eine andere taste druecke.</p>
<p>ciao, ben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971545</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971545</guid><dc:creator><![CDATA[macinstyle]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:19:47 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:26:52 GMT]]></title><description><![CDATA[<p>hä, nimmst du drogen?</p>
<p>die spannung soll da sein, solange du r drückst.<br />
also kann sie doch nur weggehen, wenn du was anderes ausser r drückst.</p>
<p>ne das ist zu hoch. vllt ist mein kopp auch net mehr so das wahre^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971551</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971551</guid><dc:creator><![CDATA[dern00b]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:26:52 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:27:59 GMT]]></title><description><![CDATA[<p>vielleicht mal kbhit?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971553</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971553</guid><dc:creator><![CDATA[dern00b]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:27:59 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:30:02 GMT]]></title><description><![CDATA[<p>ich möchte aber nichts anderes drücken, die spannung soll nur da sein wenn r gedrueckt wird</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971554</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971554</guid><dc:creator><![CDATA[macinstyle]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:30:02 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:38:20 GMT]]></title><description><![CDATA[<p>dern00b schrieb:</p>
<blockquote>
<p>vielleicht mal kbhit?</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/971558</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971558</guid><dc:creator><![CDATA[dern00b]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:38:20 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:42:10 GMT]]></title><description><![CDATA[<p>an welcher stelle und wie genau?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971562</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971562</guid><dc:creator><![CDATA[macinstyle]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:42:10 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:44:52 GMT]]></title><description><![CDATA[<p>schau mal inna hilfe nach was bei kbhit passiert wie man es benutzt tralala.....</p>
<p>also soll nur spannung beim druck auf r sein.</p>
<p>hallo? wenn du r drückst machste einmal spannung und nimmst sie weg!<br />
wo ist das problem?</p>
<p>habe auch echt kein bock hier weiter so ein kinderquatsch mit michel zu machen :D, muss hier nebenbei nämlich auch noch programmieren <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/971564</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971564</guid><dc:creator><![CDATA[dern00b]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:44:52 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 16:52:14 GMT]]></title><description><![CDATA[<p>ich weiss schon was die kbhit function macht, weiss aber nicht wie ich das hier umsetzen soll....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971567</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971567</guid><dc:creator><![CDATA[macinstyle]]></dc:creator><pubDate>Fri, 20 Jan 2006 16:52:14 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Fri, 20 Jan 2006 17:02:19 GMT]]></title><description><![CDATA[<p>dann programmier mal.<br />
sry - ich habe jetzt ferierabend und fahre zu meinem haasen - sont hätte ich dir weitergeholfen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971576</guid><dc:creator><![CDATA[dern00b]]></dc:creator><pubDate>Fri, 20 Jan 2006 17:02:19 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Sat, 21 Jan 2006 11:54:21 GMT]]></title><description><![CDATA[<p>habe immer noch keine lösung gefunden..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971908</guid><dc:creator><![CDATA[macinstyle]]></dc:creator><pubDate>Sat, 21 Jan 2006 11:54:21 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Sat, 21 Jan 2006 12:27:51 GMT]]></title><description><![CDATA[<p>macinstyle schrieb:</p>
<blockquote>
<p>habe immer noch keine lösung gefunden..</p>
</blockquote>
<p>Wenn du Windows hast kannst du die GetAsyncKeyState Funktion dazu benutzen.</p>
<p>mfg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/971925</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971925</guid><dc:creator><![CDATA[joomoo]]></dc:creator><pubDate>Sat, 21 Jan 2006 12:27:51 GMT</pubDate></item><item><title><![CDATA[Reply to getch function on Sun, 22 Jan 2006 10:27:38 GMT]]></title><description><![CDATA[<p>vielen dank...die software wird fuer eine dose programmiert, ich selber bin allerdings macuser <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/972642</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/972642</guid><dc:creator><![CDATA[macinstyle]]></dc:creator><pubDate>Sun, 22 Jan 2006 10:27:38 GMT</pubDate></item></channel></rss>