I want to include touch inputs to only move right and left

Here’s what it looks like. I only want the chapter to only go to two directions.