Alternatives to sewing (or any habit) to stay focused in class
If sewing helps you learn, consider bringing it to an in-person lecture. 


In a large lecture hall, I seriously doubt anyone will notice/care
In a more intimate class, it could be worth asking the professor if they mind. 


While you might have a bad experience with a grouchy professor, I think the vast majority will either understand or not care, particularly if you are clearly engaging. Personally, I would rather have a student paying attention while sewing than on their phone.