MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / input

Method input

src/components/TextListComponent.h:186–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184
185template <typename T>
186bool TextListComponent<T>::input(InputConfig* config, Input input)
187{
188 if(mRowVector.size() > 0)
189 {
190 if(input.value != 0)
191 {
192 if(config->isMappedTo("down", input))
193 {
194 setScrollDir(1);
195 scroll();
196 return true;
197 }
198
199 if(config->isMappedTo("up", input))
200 {
201 setScrollDir(-1);
202 scroll();
203 return true;
204 }
205 if(config->isMappedTo("pagedown", input))
206 {
207 setScrollDir(10);
208 scroll();
209 return true;
210 }
211
212 if(config->isMappedTo("pageup", input))
213 {
214 setScrollDir(-10);
215 scroll();
216 return true;
217 }
218 }else{
219 if(config->isMappedTo("down", input) || config->isMappedTo("up", input) || config->isMappedTo("pagedown", input) || config->isMappedTo("pageup", input))
220 {
221 stopScrolling();
222 }
223 }
224 }
225
226 return GuiComponent::input(config, input);
227}
228
229template <typename T>
230void TextListComponent<T>::setScrollDir(int val)

Callers

nothing calls this directly

Calls 2

isMappedToMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected