title: How to handle touch on 2 buttons
body: <p>I am new in react native, i'm trying to create a gamepad on android (play game on pc by using phone). I have 6 buttons: left, right, up, down, shoot and jump.</p>
  
  <p>When I touch a button, it will send current key to nodejs on my computer vie socket.io</p>
  
  <p>It works. But problem is: when I hold Left button then press shoot button, it can not shoot. How I handle multiple button down and up separately?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import React, { Component } from 'react';
  import {
      View,
      StyleSheet,
      Text,
      StatusBar,
      TextInput,
  } from 'react-native';
  import io from 'socket.io-client';
  
  class GameController extends Component {
  
      state = {
          settingModalVisible: false,
          socketIo: io.connect('http://192.168.0.105:3000')
      };
  
      render() {
          return (
              &lt;View style={styles.container}&gt;
                  &lt;StatusBar hidden /&gt;
                  &lt;View style={styles.row}&gt;
                      &lt;Text&gt;Setting&lt;/Text&gt;
                      &lt;TextInput style={{ height: 40, borderColor: 'gray', borderWidth: 1 }} /&gt;
                  &lt;/View&gt;
                  &lt;View style={styles.row}&gt;
                      &lt;View
                          onTouchStart={(e) =&gt; {
                              this.state.socketIo.emit('buttonDown', 'a');
                              return true;
                          }}
                          onTouchEnd={(e) =&gt; {
                              this.state.socketIo.emit('buttonUp', 'a');
                              return true;
                          }}
                          style={styles.button}
                      &gt;
                          &lt;Text&gt;Left&lt;/Text&gt;
                      &lt;/View&gt;
                      &lt;View
                          onTouchStart={(e) =&gt; {
                              this.state.socketIo.emit('buttonDown', 'd');
                              return true;
                          }}
                          onTouchEnd={(e) =&gt; {
                              this.state.socketIo.emit('buttonUp', 'd');
                              return true;
                          }}
                          style={styles.button}
                      &gt;
                          &lt;Text&gt;Right&lt;/Text&gt;
                      &lt;/View&gt;
                      &lt;View
                          onTouchStart={(e) =&gt; {
                              this.state.socketIo.emit('buttonDown', 'w');
                              return true;
                          }}
                          onTouchEnd={(e) =&gt; {
                              this.state.socketIo.emit('buttonUp', 'w');
                              return true;
                          }}
                          style={styles.button}
                      &gt;
                          &lt;Text&gt;Up&lt;/Text&gt;
                      &lt;/View&gt;
                      &lt;View
                          onTouchStart={(e) =&gt; {
                              this.state.socketIo.emit('buttonDown', 's');
                              return true;
                          }}
                          onTouchEnd={(e) =&gt; {
                              this.state.socketIo.emit('buttonUp', 's');
                              return true;
                          }}
                          style={styles.button}
                      &gt;
                          &lt;Text&gt;Down&lt;/Text&gt;
                      &lt;/View&gt;
                      &lt;View
                          onTouchStart={(e) =&gt; {
                              this.state.socketIo.emit('buttonDown', 'j');
                              return true;
                          }}
                          onTouchEnd={(e) =&gt; {
                              this.state.socketIo.emit('buttonUp', 'j');
                              return true;
                          }}
                          style={styles.button}
                      &gt;
                          &lt;Text&gt;Shoot&lt;/Text&gt;
                      &lt;/View&gt;
                      &lt;View
                          onTouchStart={(e) =&gt; {
                              this.state.socketIo.emit('buttonDown', 'k');
                              return true;
                          }}
                          onTouchEnd={(e) =&gt; {
                              this.state.socketIo.emit('buttonUp', 'k');
                              return true;
                          }}
                          style={styles.button}
                      &gt;
                          &lt;Text&gt;Jump&lt;/Text&gt;
                      &lt;/View&gt;
                  &lt;/View&gt;
              &lt;/View&gt;
          );
      }
  
  }
  </code></pre>
  
  <p>Thanks in advance!</p>