New details revealed in court about what happened before Kentucky sheriff fatally shot judge