<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to distinguish arrow-key from escape character with getch in C? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-distinguish-arrow-key-from-escape-character-with-getch-in/m-p/34588#M25326</link>
    <description>&lt;P&gt;I want to know weather an arrow key or the escape character has ben pressed. But in order to check which arrow key has been pressed I need to do multiple blocking getch-calls bc the arrow-key sequence is bigger than 1 char. This is a problem when I check for the escape char bc it only needs 1 char and this first char is identical to the one arrow returns. So I call the first getch which gets the escape character but afterwards I have to call getch two more times to check its not an arrow-key. Is there a way to know weather escape has been pressed without doing two more getch-calls afterwards to check for the arrow-keys &amp;lt;a href = "&lt;A href="https://azar.pro" target="_blank"&gt;https://azar.pro&lt;/A&gt;"&amp;gt; Azar &amp;lt;/a&amp;gt;?&lt;/P&gt;
&lt;P&gt;&amp;lt;a href = "&lt;A href="https://chatrandom.download/" target="_blank"&gt;https://chatrandom.download/&lt;/A&gt;"&amp;gt; Chatrandom &amp;lt;/a&amp;gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 21 Mar 2025 13:27:09 GMT</pubDate>
    <dc:creator>missyT</dc:creator>
    <dc:date>2025-03-21T13:27:09Z</dc:date>
    <item>
      <title>How to distinguish arrow-key from escape character with getch in C?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-distinguish-arrow-key-from-escape-character-with-getch-in/m-p/34588#M25326</link>
      <description>&lt;P&gt;I want to know weather an arrow key or the escape character has ben pressed. But in order to check which arrow key has been pressed I need to do multiple blocking getch-calls bc the arrow-key sequence is bigger than 1 char. This is a problem when I check for the escape char bc it only needs 1 char and this first char is identical to the one arrow returns. So I call the first getch which gets the escape character but afterwards I have to call getch two more times to check its not an arrow-key. Is there a way to know weather escape has been pressed without doing two more getch-calls afterwards to check for the arrow-keys &amp;lt;a href = "&lt;A href="https://azar.pro" target="_blank"&gt;https://azar.pro&lt;/A&gt;"&amp;gt; Azar &amp;lt;/a&amp;gt;?&lt;/P&gt;
&lt;P&gt;&amp;lt;a href = "&lt;A href="https://chatrandom.download/" target="_blank"&gt;https://chatrandom.download/&lt;/A&gt;"&amp;gt; Chatrandom &amp;lt;/a&amp;gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2025 13:27:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-distinguish-arrow-key-from-escape-character-with-getch-in/m-p/34588#M25326</guid>
      <dc:creator>missyT</dc:creator>
      <dc:date>2025-03-21T13:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to distinguish arrow-key from escape character with getch in C?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-distinguish-arrow-key-from-escape-character-with-getch-in/m-p/34589#M25327</link>
      <description>&lt;P&gt;getch () function returns two keycodes for arrow keys. Arrow put to getch '\033'&lt;/P&gt;&lt;P&gt; and '[' and letter from A to D (up, down, right, left) so code will be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if (getch() == '\033')  { 
    getch(); // [ value
    switch(getch())
    { 
        case 'A':
            // your code
        case 'B':
            // your code
        case 'C':
            //your code
        case 'D':
            //your code
    }
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 11:59:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-distinguish-arrow-key-from-escape-character-with-getch-in/m-p/34589#M25327</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2021-11-22T11:59:11Z</dc:date>
    </item>
  </channel>
</rss>

