Grab keyboard inside a loop for XCB as well