How to pass the current WebDriver element to a keyword?

I want to login using a Keyword like this:

CustomKeywords.'methods.QAfunc.login'(driver, email, password)

Inside the login keyword I will fill in the credentials something like this:

public static void login(WebDriver driver, String email, String password){
        //Insert user email
        driver.sendKeys('testObject', <EMAIL>);
        //Insert user password
        driver.sendKeys('testObject', <PASSWORD>); 
        //Click 'login''testObject');        

Is there a way to do that?

You can refer to this page:

Thank you

I still can’t use saved test objects inside my keywords…
Any idea of doing so?

@Zarashima the link you provided is broken!. can you provide an answer to this…? I have the same need and cant seem to get a clear answer… In my case a have a table object that I want to pass to a custom keyword.
the custom keyword will scan the dynamic table and look for particular values on certain cells.

Custom Keywords are just Java/Groovy methods:

public void scanTable(TestObject myTable) {
    // some code to scan the table...