How to use playdate.ui.gridview:getSelection()?

Trying to get it for where if A is just pressed and a specific column is selected then another menu pops up. However getSelection returns 3 numbers spaced out and I dont know how to specifically target if one of them is true in a true/false statement?


if pd.buttonJustPressed(pd.kButtonA) and gridview:getSelection() == (what do I put here for columns?) then



You'll need to capture all three return values before testing:

local section, row, column = gridView:getSelection()
if pd.buttonJustPressed(pd.kButtonA) and column == 1 then   -- (or whatever you're testing for)
  -- ...

Thank you so much, this worked!

1 Like