This is stuff you should be looking up so I'm not going to detail extensively, however.
Usually to move things in a 3d world you modify the world transform for each object. You should have learned the basic idea already that the vertex shader(among other things) is essentially responsible for determining the final position of each vertex. It does that by multiplying the vertex position by the world-view-projection matrix, which is a matrix created by multiplying the world transform(essentially the position, rotation, scaling of the object in the world relative to the world origin) by the view and projection matrices(you can look that up.)
Hence to move the triangle you would change the world matrix, moving it in either direction based on which of your keys are hit. Usually you don't want to physically modify the vertices for each object. For a triangle that might seem strange but think of if your triangle was a model with 10k vertices. Moving each one by hand would be quite a nightmare.
Usually your most simplistic shader will take inputs for either the WVP matrix or the seperate matrices and combine them inside the shader, the difference lying in where you want to do the computation, on the cpu or on the gpu.