THE AIM OF THE EXPERIMENTS DESCRIBED IN THIS PAPER IS TO EVALUATE THE USE OF KEYBOARD AND MOUSE DYNAMICS AS AN APPROPRIATE NON-OBTRUSIVE SENSORY INPUT FOR AN SYSTEM THAT IS SENSITIVE TO THE AFFECTIVE STATE OF ITS USER. OUR MOTIVATION FOR STARTING THIS RESEARCH LINE HAS BEEN THE LACK OF TOOLS AND METHODOLOGIES FOR TAKING INTO ACCOUNT THIS AFFECTIVE STATE IN LEARNING ENVIRONMENTS. IN AN IDEAL SITUATION, WHEN INSTRUCTORS HAVE TO CHOOSE FROM A COLLECTION OF PROGRAMMING ASSIGNMENTS, THEY SHOULD CONSIDER THE STUDENT'S AFFECTIVE STATE AND SKILLS IN ORDER TO SELECT A LEARNING RESOURCE WITH THE APPROPRIATE LEVEL OF DIFFICULTY. HOWEVER, NEITHER THE DATA OR THE ABILITY TO PROCESS IT ARE PRESENT IN CURRENT LEARNING MANAGEMENT SYSTEMS. THIS WORK TRIES TO ADDRESS THIS PROBLEM, BY FOCUSED ON THE CAPTURE AND PRE-PROCESSING OF DATA THAT IS GOING TO BE FED TO SEVERAL MACHINE LEARNING TECHNIQUES WITH THE OBJECTIVE OF CLASSIFYING THE AFFECTIVE STATES OF USERS WITH DIFFERENT LEVELS OF EXPERTISE WHEN LEARNING A NEW PROGRAMMING LANGUAGE. WE CAPTURE STUDENT DATA FROM A WEB-BASED PLATFORM, A LEARNING MANAGEMENT SYSTEM WHERE STUDENTS INTERACT WITH PROGRAMMING EXERCISES. WE INTRODUCE IN THIS PAPER A SERIES OF PRE-PROCESSING TECHNIQUES THAT ARE ABLE TO CONVERT DATA FROM KEYBOARD AND MOUSE DYNAMICS CAPTURED FROM STUDENTS AS THEY WERE CODING BASIC PYTHON PROGRAMMING ASSIGNMENTS INTO FEATURE VECTOR, THAT HAVE BEEN LATER USED FOR THE CLASSIFICATION INTO FIVE AFFECTIVE STATES: BOREDOM, FRUSTRATION, DISTRACTION, RELAXATION AND ENGAGEMENT. THE FOLLOWING CLASSIFICATION ALGORITHMS HAVE BEEN EVALUATED: K-NEAREST NEIGHBORS,FEED FORWARD NEURAL NETWORKS, NAIVE BAYES CLASSIFIER, J-48 TREE INDUCTION ALGORITHM, DEEP LEARNING, RANDOM FOREST, GRADIENT BOOSTED TREES AND NAIVE BAYES KERNEL). THE BEST ACCURACY WAS AROUND 78% AND WAS ACHIEVED BY THE TREE INDUCTION ALGORITHMS. RESULTS SHOW THAT DATA GATHERED FROM READY-AVAILABLE, NON-OBTRUSIVE SENSORS CAN BE USED SUCCESSFULLY AS ANOTHER INPUT TO HYBRID CLASSIFICATION MODELS IN ORDER TO PREDICT AN INDIVIDUAL'S AFFECTIVE STATES, AND THESE IN TURN CAN BE USED TO MAKE STUDENTS MORE ENGAGED AND THUS LEARN MORE EFFICIENTLY.